Skip to content

Instantly share code, notes, and snippets.

@panticz
Created December 13, 2016 09:26
Show Gist options
  • Save panticz/638b8077e57147212a159b0fd4453d1e to your computer and use it in GitHub Desktop.
Save panticz/638b8077e57147212a159b0fd4453d1e to your computer and use it in GitHub Desktop.
# https://dev.icinga.com/issues/11732
diff /usr/share/icinga/htdocs/js/menu.js.2016-12-13 /usr/share/icinga/htdocs/js/menu.js
10,18c10,21
< elem.prepend( img )
< .css( "cursor", "pointer" )
< .toggle( function() {
< img.attr('src', 'images/menu_more.gif');
< list.slideToggle("slow");
< }, function() {
< img.attr('src', 'images/menu_less.gif');
< list.slideToggle("slow");
< });
---
> elem.prepend( img )
> .css( "cursor", "pointer" )
> .click( function() {
> if($(this).hasClass("collapsed")) {
> img.attr('src', 'images/menu_less.gif');
> $(this).removeClass("collapsed");
> } else {
> img.attr('src', 'images/menu_more.gif');
> $(this).addClass("collapsed");
> }
> list.slideToggle("slow");
> });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment