X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/17762048701cea3eb0d213b2b4d2db2c25b9de58..7f95b51b00d0d5fa1e7bcf5574f2d58bddcbd504:/resources/assets/js/components/page-display.js diff --git a/resources/assets/js/components/page-display.js b/resources/assets/js/components/page-display.js index 260600d34..e7dacea64 100644 --- a/resources/assets/js/components/page-display.js +++ b/resources/assets/js/components/page-display.js @@ -1,4 +1,4 @@ -import Clipboard from "clipboard"; +import Clipboard from "clipboard/dist/clipboard.min"; import Code from "../services/code"; class PageDisplay { @@ -128,7 +128,7 @@ class PageDisplay { let $bookTreeParent = $sidebar.parent(); // Check the page is scrollable and the content is taller than the tree - let pageScrollable = ($(document).height() > $window.height()) && ($sidebar.height() < $('.page-content').height()); + let pageScrollable = ($(document).height() > ($window.height() + 40)) && ($sidebar.height() < $('.page-content').height()); // Get current tree's width and header height let headerHeight = $("#header").height() + $(".toolbar").height(); @@ -136,7 +136,7 @@ class PageDisplay { // Fix the tree as a sidebar function stickTree() { - $sidebar.width($bookTreeParent.width() + 15); + $sidebar.css('width', $bookTreeParent.width()); $sidebar.addClass("fixed"); isFixed = true; } @@ -233,4 +233,4 @@ class PageDisplay { } } -module.exports = PageDisplay; +export default PageDisplay;