diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 123c4ad8e81..5c14cf34bb3 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1132,6 +1132,7 @@ function initCore() { setupMainMenu(); + // App sidebar on mobile var snapper = new Snap({ element: document.getElementById('app-content'), @@ -1146,6 +1147,25 @@ function initCore() { snapper.open('left'); } }); + // close sidebar when switching navigation entry + var $appNavigation = $('#app-navigation'); + $appNavigation.delegate('a', 'click', function(event) { + var $target = $(event.target); + // don't hide navigation when changing settings or adding things + if($target.is('.app-navigation-noclose') || + $target.closest('.app-navigation-noclose').length) { + return; + } + if($target.is('.add-new') || + $target.closest('.add-new').length) { + return; + } + if($target.is('#app-settings') || + $target.closest('#app-settings').length) { + return; + } + snapper.close(); + }); } $(document).ready(initCore); |