aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authortommy tomson <thomas.bierey@gmx.de>2012-04-30 02:00:41 +0200
committertommy tomson <thomas.bierey@gmx.de>2012-04-30 02:00:41 +0200
commitab908469ae89cbc7ba3b45b25fd85668e51abaea (patch)
tree1cc69804b325c0db14de9f108511ad7e8d77b6e1 /js
parentdef6f0b408680c4e5f209890bbf1ad6bf40b5add (diff)
downloadvolse-hubzilla-ab908469ae89cbc7ba3b45b25fd85668e51abaea.tar.gz
volse-hubzilla-ab908469ae89cbc7ba3b45b25fd85668e51abaea.tar.bz2
volse-hubzilla-ab908469ae89cbc7ba3b45b25fd85668e51abaea.zip
close one menu (like the notifications menu) when another one is opened (like it is done when clicking somewhere else) (thx to ^mw)
Diffstat (limited to 'js')
-rw-r--r--js/main.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/js/main.js b/js/main.js
index ac238bf6a..6a2632441 100644
--- a/js/main.js
+++ b/js/main.js
@@ -73,7 +73,16 @@
setupFieldRichtext();
/* popup menus */
+ function close_last_popup_menu() {
+ if(last_popup_menu) {
+ last_popup_menu.hide();
+ last_popup_button.removeClass("selected");
+ last_popup_menu = null;
+ last_popup_button = null;
+ }
+ }
$('a[rel^=#]').click(function(e){
+ close_last_popup_menu();
menu = $( $(this).attr('rel') );
e.preventDefault();
e.stopPropagation();
@@ -90,12 +99,7 @@
return false;
});
$('html').click(function() {
- if(last_popup_menu) {
- last_popup_menu.hide();
- last_popup_button.removeClass("selected");
- last_popup_menu = null;
- last_popup_button = null;
- }
+ close_last_popup_menu();
});
// fancyboxes