]> git.mxchange.org Git - friendica.git/commitdiff
close one menu (like the notifications menu) when another one is opened (like it...
authortommy tomson <thomas.bierey@gmx.de>
Mon, 30 Apr 2012 00:00:41 +0000 (02:00 +0200)
committertommy tomson <thomas.bierey@gmx.de>
Mon, 30 Apr 2012 00:00:41 +0000 (02:00 +0200)
js/main.js

index ac238bf6aa65d568702491da2a8b46cf359c5864..6a26324419284f42e3771f4db77fc1a4fe4d2a8f 100644 (file)
                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();
                        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