Skip to content

Instantly share code, notes, and snippets.

@auniverseaway
Created January 25, 2015 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save auniverseaway/6fcd237c4c8d186e5649 to your computer and use it in GitHub Desktop.
Save auniverseaway/6fcd237c4c8d186e5649 to your computer and use it in GitHub Desktop.
$('.level1>.x-panel-bwrap>.x-panel-tbar, .level2>.x-panel-bwrap>.x-panel-tbar, .level3>.x-panel-bwrap>.x-panel-tbar').click(function(){
parent = this.parentNode;
body = $(parent).children('.x-panel-body');
xpanel = $(body).children('.x-panel');
// I always specifically open and close because I've seen some issues with toggleClass. - CM
if($(this).hasClass('open')) {
$(this).removeClass('open');
$(xpanel).removeClass('open');
} else {
$(this).addClass('open');
$(xpanel).addClass('open');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment