enable possibility to have multiple active top menus

pull/729/head
Johannes Wollert 11 years ago
parent 43069729b8
commit 8086fb4b3c
  1. 15
      app/assets/javascripts/top_menu.js

@ -240,9 +240,22 @@
}
});
// this holds all top menus currently active.
// if one opens, all others are closed.
var top_menus = [];
$.fn.top_menu = function () {
var new_menu;
$(this).each(function () {
new TopMenu($(this));
new_menu = new TopMenu($(this));
top_menus.each(function (menu) {
menu.menu_container.on("openedMenu", function () {
new_menu.closing();
});
new_menu.menu_container.on("openedMenu", function () {
menu.closing();
});
});
top_menus.push(new_menu);
});
}
}(jQuery));

Loading…
Cancel
Save