]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/components/page-display.js
Updated 'Spanish Argentina' translation.
[bookstack] / resources / assets / js / components / page-display.js
index 257deedda834f3377a796e1f034c68af33acd2ad..cbb672222c264cc1ab5114269771989f9f1aa9aa 100644 (file)
@@ -1,4 +1,4 @@
-import Clipboard from "clipboard";
+import Clipboard from "clipboard/dist/clipboard.min";
 import Code from "../services/code";
 
 class PageDisplay {
@@ -20,7 +20,7 @@ class PageDisplay {
 
         // Sidebar page nav click event
         $('.sidebar-page-nav').on('click', 'a', event => {
-            goToText(event.target.getAttribute('href').substr(1));
+            this.goToText(event.target.getAttribute('href').substr(1));
         });
     }
 
@@ -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();
@@ -233,4 +233,4 @@ class PageDisplay {
     }
 }
 
-module.exports = PageDisplay;
+export default PageDisplay;