Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plugin.prototype.toggleSubmenu = function($item) {
- if($item.children('ul').length) { // check if the treeitem contains submenu
- if ($item.hasClass('collapsed')) { // expand if collapsed
- $item
- .attr({
- 'aria-expanded': true
- })
- .removeClass('collapsed');
- } else { // otherwise collapse
- $item
- .attr({
- 'aria-expanded': false
- })
- .addClass('collapsed');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment