Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ected. Add new 'select' event for easier customization
  • Loading branch information...
commit 475e055b1858e5eed746b1c4ebd0fa7d75909ece 1 parent e40d3d4
@chillu chillu authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 admin/javascript/LeftAndMain.Menu.js
View
7 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');
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.