diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 5563c5e04..9b68455e3 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -50,8 +50,8 @@ const BrewPage = (props)=>{ props.onVisibilityChange(props.index + 1, true, false); // add page to array of visible pages. else props.onVisibilityChange(props.index + 1, false, false); - } - )}, + }); + }, { threshold: .3, rootMargin: '0px 0px 0px 0px' } // detect when >30% of page is within bounds. ); @@ -61,8 +61,8 @@ const BrewPage = (props)=>{ entries.forEach((entry)=>{ if(entry.isIntersecting) props.onVisibilityChange(props.index + 1, true, true); // Set this page as the center page - } - )}, + }); + }, { threshold: 0, rootMargin: '-50% 0px -50% 0px' } // Detect when the page is at the center ); diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.jsx b/client/homebrew/brewRenderer/toolBar/toolBar.jsx index ce60971aa..72ab02c9a 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.jsx +++ b/client/homebrew/brewRenderer/toolBar/toolBar.jsx @@ -62,7 +62,7 @@ const ToolBar = ({ displayOptions, onDisplayOptionsChange, visiblePages, totalPa // find the page with the largest single dim (height or width) so that zoom can be adapted to fit it. if(displayOptions.spread === 'facing') minDimRatio = [...pages].reduce((minRatio, page)=>Math.min(minRatio, iframeWidth / page.offsetWidth / 2), Infinity); // if 'facing' spread, fit two pages in view - else + else minDimRatio = [...pages].reduce((minRatio, page)=>Math.min(minRatio, iframeWidth / page.offsetWidth, iframeHeight / page.offsetHeight), Infinity); desiredZoom = minDimRatio * 100; diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 7c7044832..c784edc8e 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -432,41 +432,41 @@ const EditPage = createClass({ {this.renderNavbar()} {this.props.brew.lock && } -
- - - - +
+ + + +
; }