On container mousedown, make sure to compare the appropriate element.

Fixes #350.
This commit is contained in:
Patrick Filler 2011-11-15 12:39:16 -05:00
parent 31cd33f22b
commit 5808c97172
3 changed files with 3 additions and 3 deletions

View file

@ -390,7 +390,7 @@
}
$(document).click(this.click_test_action);
this.results_show();
} else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) {
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
evt.preventDefault();
this.results_toggle();
}

File diff suppressed because one or more lines are too long

View file

@ -113,7 +113,7 @@ class Chosen extends AbstractChosen
@search_field.val "" if @is_multiple
$(document).click @click_test_action
this.results_show()
else if not @is_multiple and evt and ($(evt.target) is @selected_item || $(evt.target).parents("a.chzn-single").length)
else if not @is_multiple and evt and (($(evt.target)[0] == @selected_item[0]) || $(evt.target).parents("a.chzn-single").length)
evt.preventDefault()
this.results_toggle()