Przeglądaj źródła

modified calcuration for scroll bar height

mayu morita 7 lat temu
rodzic
commit
4b545c349d
1 zmienionych plików z 25 dodań i 23 usunięć
  1. 25 23
      lib/views/layout-growi/base/layout.html

+ 25 - 23
lib/views/layout-growi/base/layout.html

@@ -28,34 +28,36 @@
 
 
 
 
 <!-- Side Scroll Bar-->
 <!-- Side Scroll Bar-->
+
 <script>
 <script>
-  function DrawScrollbar() {
-     var h = window.innerHeight - document.getElementById('page-header').clientHeight ;
-    $('#revision-toc-content').slimScroll({
-      railVisible: true,
-      position: 'right',
-      height: h,
-    });
-  }
-
-  $(function(){
-    DrawScrollbar();
+
+function DrawScrollbar() {
+
+  var h = window.innerHeight - ((document.getElementById('revision-toc').clientHeight))/2 ;
+  $('#revision-toc-content').slimScroll({
+    railVisible: true,
+    height: h,
   });
   });
+}
+
+$(function(){
+  DrawScrollbar();
+});
 
 
-  (function () {
-    var timer = 0;
+(function () {
+  var timer = 0;
 
 
-    window.onresize = function () {
-      if (timer > 0) {
-        clearTimeout(timer);
-      }
+  window.onresize = function () {
+    if (timer > 0) {
+      clearTimeout(timer);
+    }
 
 
-      timer = setTimeout(function () {
-        DrawScrollbar();
-      }, 200);
-    };
-  }());
-  </script>
+    timer = setTimeout(function () {
+      DrawScrollbar();
+    }, 200);
+  };
+}());
+</script>
 
 
 <footer class="footer">
 <footer class="footer">
   {% include '../../widget/system-version.html' %}
   {% include '../../widget/system-version.html' %}