Skip to content

Commit

Permalink
Replaced the obsolete toggle event handling JS function
Browse files Browse the repository at this point in the history
The toggle(func1, func2) event handling function has been removed
in jQuery 1.9.
  • Loading branch information
claudep committed Feb 20, 2013
1 parent 8bbca21 commit 4246fe6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions django/contrib/admin/static/admin/js/collapse.js
Expand Up @@ -10,15 +10,15 @@
} }
}); });
// Add toggle to anchor tag // Add toggle to anchor tag
$("fieldset.collapse a.collapse-toggle").toggle( $("fieldset.collapse a.collapse-toggle").click(function(ev) {
function() { // Show if ($(this).closest("fieldset").hasClass("collapsed")) {
// Show
$(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
return false; } else {
}, // Hide
function() { // Hide
$(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
return false;
} }
); return false;
});
}); });
})(django.jQuery); })(django.jQuery);
4 changes: 2 additions & 2 deletions django/contrib/admin/static/admin/js/collapse.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4246fe6

Please sign in to comment.