Explorar o código

sidebar: width is 0 when hidden

Nils Schneider %!s(int64=9) %!d(string=hai) anos
pai
achega
706bc2c1fc
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      lib/sidebar.js

+ 3 - 0
lib/sidebar.js

@@ -19,6 +19,9 @@ define([], function () {
     sidebar.appendChild(container)
 
     self.getWidth = function () {
+      if (sidebar.classList.contains("hidden"))
+          return 0
+
       var small = window.matchMedia("(max-width: 60em)")
       return small.matches ? 0 : sidebar.offsetWidth
     }