Skip to content

Commit

Permalink
Fixed resetting selectedIndex too early
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemacfarlane committed Jul 23, 2012
1 parent 324c496 commit 0ddc0d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions django/contrib/admin/static/admin/js/SelectBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var SelectBox = {
node.select_boxed = false;
SelectBox.add_to_options(id, node);
}
SelectBox.move(field_id);
// This prevents a jump on focus if options have been moved out
box.selectedIndex = -1;
},
redisplay: function(id, both) {
Expand Down
2 changes: 0 additions & 2 deletions django/contrib/admin/static/admin/js/SelectFilter2.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ window.SelectFilter = {
addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id, true); SelectFilter.refresh_icons(field_id); });
addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); });
SelectBox.init(field_id);
// Move selected from_box options to to_box
SelectBox.move(field_id);

if (!is_stacked) {
// In horizontal mode, give the same height to the two boxes.
Expand Down

0 comments on commit 0ddc0d1

Please sign in to comment.