doortts doortts 2019-01-17
sidebar: Fix scrollbar bug
- Remove iframe height calculation logic
- Turn on iframe default scroll
- Increase sidebar heigth 99vh to 100vh
@40f27d5d5c1e62d5a95f7698936cb530f44366f6
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -1,5 +1,9 @@
 //--- common
 
+.framed-body {
+    overflow: hidden;
+}
+
 .main {
     width: 100%;
     background-color: #fff;
@@ -3525,6 +3529,10 @@
 
     .help { display:none; }
 
+    .help-droppable {
+        display: inline;
+    }
+
     .attach-wrap {
         text-align:center;
 
app/assets/stylesheets/less/_usermenu.less
--- app/assets/stylesheets/less/_usermenu.less
+++ app/assets/stylesheets/less/_usermenu.less
@@ -65,7 +65,6 @@
   .user-ul {
     -ms-overflow-style: -ms-autohiding-scrollbar;
     overflow-y: scroll;
-    height: 100vh;
 
     &::-webkit-scrollbar {
       height: 10px;
app/assets/stylesheets/less/_yobiUI.less
--- app/assets/stylesheets/less/_yobiUI.less
+++ app/assets/stylesheets/less/_yobiUI.less
@@ -9,7 +9,7 @@
 body {
     font-size:13px;
     display: flex;
-    min-height: 99vh;
+    min-height: 100vh;
 }
 label, input, button, select, textarea { font-size:12px; }
 select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"],
app/views/layout_framed.scala.html
--- app/views/layout_framed.scala.html
+++ app/views/layout_framed.scala.html
@@ -51,14 +51,14 @@
 
 </head>
 
-<body class="@theme" id="html-body">
+<body class="@theme framed-body" id="html-body">
     <div id="sidebar" class="sidebar hide-in-mobile">
         @if(!currentUser.isAnonymous){
             @sidebar()
         }
     </div>
     <div id="mainFrame">
-        <iframe name="mainFrame" frameborder="0" class="mainFrame" scrolling="no" height="100%" width="100%" src="@iframePath"  scrolling="no" onload="resizeIframe(this)"></iframe>
+        <iframe name="mainFrame" frameborder="0" class="mainFrame" height="100%" width="100%" src="@iframePath"  onload="resizeIframe(this)"></iframe>
         @common.scripts()
     </div>
 
@@ -77,9 +77,6 @@
                 $('#mainFrame').removeClass("loading-gif");
                 $('.mainFrame').show();
 
-                obj.style.height = '100vh'; // Before calculate new content height, reduce it to 100vh.
-                                            // It prevents unintended long height
-                obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
                 window.scrollTo(0, 0);
             }, 0);
         }

Add a comment
List