Permalink
Browse files

Fixed #17218 -- Fixed bug with SelectFilter where the 'to' box had a …

…height=0 when it was within a collapsed fieldset. Thanks jimallman

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 5c1c1a1 commit cfb7e477d38d76ef33883d56d69e7c5b8eba6de4 @adrianholovaty adrianholovaty committed Dec 9, 2011
@@ -97,7 +97,15 @@ window.SelectFilter = {
if (!is_stacked) {
// In horizontal mode, give the same height to the two boxes.
- $(to_box).height($(filter_p).outerHeight() + $(from_box).outerHeight());
+ var j_from_box = $(from_box);
+ var j_to_box = $(to_box);
+ var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); }
+ if (j_from_box.outerHeight() > 0) {
+ resize_filters(); // This fieldset is already open. Resize now.
+ } else {
+ // This fieldset is probably collapsed. Wait for its 'show' event.
+ j_to_box.closest('fieldset').one('show.fieldset', resize_filters);
+ }
}
// Initial icon refresh
@@ -12,11 +12,11 @@
// Add toggle to anchor tag
$("fieldset.collapse a.collapse-toggle").toggle(
function() { // Show
- $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed");
+ $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
return false;
},
function() { // Hide
- $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed");
+ $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
return false;
}
);

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

Oops, something went wrong.

0 comments on commit cfb7e47

Please sign in to comment.