Permalink
Browse files

MINOR Avoid triggering $('.cms-menu') item selection when already sel…

…ected. Add new 'select' event for easier customization
  • Loading branch information...
chillu committed Jul 15, 2011
1 parent e40d3d4 commit 475e055b1858e5eed746b1c4ebd0fa7d75909ece
Showing with 6 additions and 1 deletion.
  1. +6 −1 admin/javascript/LeftAndMain.Menu.js
@@ -34,7 +34,10 @@
$('.cms-container').bind('afterstatechange', function(e, data) {
var controller = data.xhr.getResponseHeader('X-Controller');
- if(controller) self.find('li#Menu-' + controller).select();
+ if(controller) {
+ var item = self.find('li#Menu-' + controller);
+ if(!item.hasClass('current')) item.select();
+ }
});
// Sync collapsed state with parent panel
@@ -72,6 +75,8 @@
this.siblings().removeClass('current').close();
this.siblings().find('li').removeClass('current');
if(parent) parent.addClass('current').siblings().removeClass('current');
+
+ this.trigger('select');
}
});

0 comments on commit 475e055

Please sign in to comment.