Permalink
Browse files

Replaced the obsolete toggle event handling JS function

The toggle(func1, func2) event handling function has been removed
in jQuery 1.9.
  • Loading branch information...
1 parent 8bbca21 commit 4246fe6006090c08dcb2966889f74f48c80c5e65 @claudep claudep committed Feb 18, 2013
@@ -10,15 +10,15 @@
}
});
// Add toggle to anchor tag
- $("fieldset.collapse a.collapse-toggle").toggle(
- function() { // Show
+ $("fieldset.collapse a.collapse-toggle").click(function(ev) {
+ if ($(this).closest("fieldset").hasClass("collapsed")) {
+ // Show
$(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
- return false;
- },
- function() { // Hide
+ } else {
+ // Hide
$(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
- return false;
}
- );
+ return false;
+ });
});
})(django.jQuery);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 4246fe6

Please sign in to comment.