Skip to content

Instantly share code, notes, and snippets.

@joshperry
Forked from auniverseaway/gist:6fcd237c4c8d186e5649
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshperry/36e7d9adfb0b0c7955b8 to your computer and use it in GitHub Desktop.
Save joshperry/36e7d9adfb0b0c7955b8 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