diff --git a/include/themes/dark/main.js b/include/themes/dark/main.js index 48c9b8f5b..57ce5c281 100644 --- a/include/themes/dark/main.js +++ b/include/themes/dark/main.js @@ -237,8 +237,9 @@ function setMenuVisibility() { }); // Functon to give life to the Navigation pane - $('#nav li:has(ul) a.active').unbind().click(function() { + $('#nav li:has(ul) a.active').unbind().click(function(event) { event.preventDefault(); + if ($(this).next().is(':visible')){ $(this).next().slideUp( { duration: 200, easing: 'swing' } ); storage.set($(this).text(), 'collapsed'); diff --git a/include/themes/modern/main.js b/include/themes/modern/main.js index 4143974dc..5e32f8ec6 100644 --- a/include/themes/modern/main.js +++ b/include/themes/modern/main.js @@ -227,8 +227,9 @@ function setMenuVisibility() { }); // Functon to give life to the Navigation pane - $('#nav li:has(ul) a.active').unbind().click(function() { + $('#nav li:has(ul) a.active').unbind().click(function(event) { event.preventDefault(); + if ($(this).next().is(':visible')){ $(this).next().slideUp( { duration: 200, easing: 'swing' } ); storage.set($(this).text(), 'collapsed');