Create a gist now

Instantly share code, notes, and snippets.

# 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