simplify code for closing all other dropdowns except the current one

pull/416/head
jwollert 11 years ago
parent 6b617554a4
commit e578886c61
  1. 10
      app/assets/javascripts/top_menu.js

@ -132,11 +132,11 @@
closeOtherItems: function (dropdown) {
var self = this;
this.openDropdowns().filter(function (ix, it) {
return $(it) != $(dropdown);
}).each(function (ix, it) {
self.close($(it));
})
this.openDropdowns().each(function (ix, it) {
if ($(it) != $(dropdown)) {
self.close($(it));
}
});
},
dontCloseWhenUsing: function (dropdown) {

Loading…
Cancel
Save