Fix scrollbar shifting problem again (fix was lost in upgrade to Bootstrap 4, because...
[ndcode_site.git] / _lib / navbar.jst
index 8498bb0..8781d25 100644 (file)
@@ -45,64 +45,66 @@ return async (env, head, body, scripts) => {
       let index = env.parsed_url.pathname.indexOf('/', 1)
       let dir = index === -1 ? '' : env.parsed_url.pathname.slice(1, index)
 
-      div.container {
-        div.row.align-items-center.py-3 {
-          div.col-sm-8 {
-            _out.push(logo_large)
-          }
-          div.'col-sm-4' {
-            //div {
-            //  let signed_in =
-            //    Object.prototype.hasOwnProperty.call(env.session, 'account')
-            //  span#signed-in-status {
-            //    if (signed_in)
-            //      `Signed in as ${env.session.account}.`
-            //    else
-            //      'Browsing as guest.'
-            //  }
-            //  ' '
-            //  if (signed_in)
-            //    a#sign-in(href="" hidden="") {'Sign in'}
-            //  else
-            //    a#sign-in(href="") {'Sign in'}
-            //  ' '
-            //  if (signed_in)
-            //    a#sign-out(href="") {'Sign out'}
-            //  else
-            //    a#sign-out(href="" hidden="") {'Sign out'}
-            //}
-            //p {}
-
-            form/*.form-inline*/(action="/search/index.html") {
-              div.input-group {
-                input.form-control(name="query" type="text" placeholder="Search" aria-describedby="search-button") {}
-                div.input-group-append {
-                  button.btn.btn-outline-secondary#search-button(type="submit") {
-                    _out.push(icon_search_mono)
+      div.scrollbar-fix {
+        div.container {
+          div.row.align-items-center.py-3 {
+            div.col-sm-8 {
+              _out.push(logo_large)
+            }
+            div.'col-sm-4' {
+              //div {
+              //  let signed_in =
+              //    Object.prototype.hasOwnProperty.call(env.session, 'account')
+              //  span#signed-in-status {
+              //    if (signed_in)
+              //      `Signed in as ${env.session.account}.`
+              //    else
+              //      'Browsing as guest.'
+              //  }
+              //  ' '
+              //  if (signed_in)
+              //    a#sign-in(href="" hidden="") {'Sign in'}
+              //  else
+              //    a#sign-in(href="") {'Sign in'}
+              //  ' '
+              //  if (signed_in)
+              //    a#sign-out(href="") {'Sign out'}
+              //  else
+              //    a#sign-out(href="" hidden="") {'Sign out'}
+              //}
+              //p {}
+  
+              form/*.form-inline*/(action="/search/index.html") {
+                div.input-group {
+                  input.form-control(name="query" type="text" placeholder="Search" aria-describedby="search-button") {}
+                  div.input-group-append {
+                    button.btn.btn-outline-secondary#search-button(type="submit") {
+                      _out.push(icon_search_mono)
+                    }
                   }
                 }
               }
             }
+  
+            //div.'col-sm-1'.vbottom {
+            //  // a nested div is used to avoid hover colour on the padding
+            //  div.nav-li-a(style="text-align: center;") {
+            //    a(href="/online_store/view_cart/index.html") {
+            //      div.cart-icon {
+            //        _out.push(icon_cart_small)
+            //      }
+            //      div.cart-number {
+            //        div.cart-circle {
+            //          `${(env.cart.items || []).length}`
+            //        }
+            //      }
+            //    }
+            //  }
+            //}
           }
-
-          //div.'col-sm-1'.vbottom {
-          //  // a nested div is used to avoid hover colour on the padding
-          //  div.nav-li-a(style="text-align: center;") {
-          //    a(href="/online_store/view_cart/index.html") {
-          //      div.cart-icon {
-          //        _out.push(icon_cart_small)
-          //      }
-          //      div.cart-number {
-          //        div.cart-circle {
-          //          `${(env.cart.items || []).length}`
-          //        }
-          //      }
-          //    }
-          //  }
-          //}
         }
       }
-      nav.navbar.navbar-expand-lg.navbar-dark.bg-primary {
+      nav.navbar.navbar-expand-lg.navbar-dark.bg-primary.scrollbar-fix {
         div.container {
           //a.navbar-brand(href="#") {'Navbar'}
           //' '
@@ -170,10 +172,12 @@ return async (env, head, body, scripts) => {
           }
         }
       }
-      div.container {
-        await body(_out)
+      div.scrollbar-fix {
+        div.container {
+          await body(_out)
+        }
       }
-      footer {
+      footer.scrollbar-fix {
         div.container {
           a(rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/") {
             img(alt="Creative Commons License" style="border-width:0;" src="/images/by-sa_3.0_88x31.png") {}