Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 4246fe6006090c08dcb2966889f74f48c80c5e65 1 parent 8bbca21
Claude Paroz claudep authored
14 django/contrib/admin/static/admin/js/collapse.js
@@ -10,15 +10,15 @@
10 10 }
11 11 });
12 12 // Add toggle to anchor tag
13   - $("fieldset.collapse a.collapse-toggle").toggle(
14   - function() { // Show
  13 + $("fieldset.collapse a.collapse-toggle").click(function(ev) {
  14 + if ($(this).closest("fieldset").hasClass("collapsed")) {
  15 + // Show
15 16 $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
16   - return false;
17   - },
18   - function() { // Hide
  17 + } else {
  18 + // Hide
19 19 $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
20   - return false;
21 20 }
22   - );
  21 + return false;
  22 + });
23 23 });
24 24 })(django.jQuery);
4 django/contrib/admin/static/admin/js/collapse.min.js
... ... @@ -1,2 +1,2 @@
1   -(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){a(b).find("div.errors").length==0&&a(b).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")});a("fieldset.collapse a.collapse-toggle").toggle(function(){a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]);return false},function(){a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset",
2   -[a(this).attr("id")]);return false})})})(django.jQuery);
  1 +(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){0==a(b).find("div.errors").length&&a(b).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")});a("fieldset.collapse a.collapse-toggle").click(function(){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset",
  2 +[a(this).attr("id")]);return!1})})})(django.jQuery);

0 comments on commit 4246fe6

Please sign in to comment.
Something went wrong with that request. Please try again.