]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/pages/page-show.js
Update/fix german translation
[bookstack] / resources / assets / js / pages / page-show.js
index cc6296434ee41c78db8494cd9e6d86338c30e67a..7754840af501dead6c215f6fd9fb8c74cf263bd8 100644 (file)
@@ -1,9 +1,12 @@
-"use strict";
-// Configure ZeroClipboard
 const Clipboard = require("clipboard");
+const Code = require('../code');
 
 let setupPageShow = window.setupPageShow = function (pageId) {
 
+    Code.highlight();
+
+    if (!pageId) return;
+
     // Set up pointer
     let $pointer = $('#pointer').detach();
     let pointerShowing = false;
@@ -81,6 +84,12 @@ let setupPageShow = window.setupPageShow = function (pageId) {
             let $idElem = $(idElem);
             let color = $('#custom-styles').attr('data-color-light');
             $idElem.css('background-color', color).attr('data-highlighted', 'true').smoothScrollTo();
+            setTimeout(() => {
+                $idElem.addClass('anim').addClass('selectFade').css('background-color', '');
+                setTimeout(() => {
+                   $idElem.removeClass('selectFade');
+                }, 3000);
+            }, 100);
         } else {
             $('.page-content').find(':contains("' + text + '")').smoothScrollTo();
         }
@@ -150,6 +159,8 @@ let setupPageShow = window.setupPageShow = function (pageId) {
         }
     });
 
+    // in order to call from other places.
+    window.setupPageShow.goToText = goToText;
 };
 
 module.exports = setupPageShow;
\ No newline at end of file