From 706bc2c1fc775ec31c85b824043180f410e4fde7 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 31 Mar 2015 20:32:47 +0200 Subject: [PATCH] sidebar: width is 0 when hidden --- lib/sidebar.js | 3 +++ 1 file changed, 3 insertions(+) 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 }