From f53dc243f128b3e4c3c6b911196ccf82bae1d54d Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Wed, 1 Feb 2017 20:41:22 +0100 Subject: [PATCH] [BUGFIX] Test property of the sidebar to set map position --- lib/sidebar.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/sidebar.js b/lib/sidebar.js index 1924c88..5fad7e5 100644 --- a/lib/sidebar.js +++ b/lib/sidebar.js @@ -21,12 +21,10 @@ define(function () { sidebar.appendChild(container); self.getWidth = function getWidth() { - if (sidebar.classList.contains('hidden')) { + if (sidebar.classList.contains('hidden') || button.offsetHeight === 0) { return 0; } - - var small = window.matchMedia('(max-width: 630pt)'); - return small.matches ? 0 : sidebar.offsetWidth; + return sidebar.offsetWidth; }; self.add = function add(d) {