diff --git a/lib/sidebar.js b/lib/sidebar.js index 2a153e6..a7cae54 100644 --- a/lib/sidebar.js +++ b/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 }