Merge pull request #276 from tomtom84/master
close one menu (like notificationsmenu) when another one is opened (like when clicking somewhere else)
This commit is contained in:
commit
384d28a6bd
16
js/main.js
16
js/main.js
|
@ -73,7 +73,16 @@
|
||||||
setupFieldRichtext();
|
setupFieldRichtext();
|
||||||
|
|
||||||
/* popup menus */
|
/* 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){
|
$('a[rel^=#]').click(function(e){
|
||||||
|
close_last_popup_menu();
|
||||||
menu = $( $(this).attr('rel') );
|
menu = $( $(this).attr('rel') );
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -90,12 +99,7 @@
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('html').click(function() {
|
$('html').click(function() {
|
||||||
if(last_popup_menu) {
|
close_last_popup_menu();
|
||||||
last_popup_menu.hide();
|
|
||||||
last_popup_button.removeClass("selected");
|
|
||||||
last_popup_menu = null;
|
|
||||||
last_popup_button = null;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// fancyboxes
|
// fancyboxes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user