From 1c9cef910b40abd81b215875ece53f6e6bf03d89 Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Mon, 9 Apr 2018 18:50:53 +0200 Subject: [PATCH] Sidebar closed by default, avoid full-screen on mobile (#112) --- js/plugin/Sidebar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/plugin/Sidebar.js b/js/plugin/Sidebar.js index 66fa954..b86dfd8 100644 --- a/js/plugin/Sidebar.js +++ b/js/plugin/Sidebar.js @@ -49,10 +49,12 @@ BR.Sidebar = L.Control.Sidebar.extend({ var tabId = localStorage.getItem(this.storageId); - // not set: open sidebar by default for new users // 'true': legacy value for toggling old sidebar - if (tabId === null || tabId === 'true') { + if (tabId === 'true') { tabId = this.options.defaultTabId; + } else if (tabId === null) { + // not set: closed by default for new users + tabId = ''; } if (tabId !== '') { this.open(tabId);