Prevent default link behavior on @selected_item
This commit is contained in:
parent
d5b62668ca
commit
2f25f9e849
|
@ -152,6 +152,7 @@
|
||||||
$(document).click(this.click_test_action);
|
$(document).click(this.click_test_action);
|
||||||
this.results_show();
|
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) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) {
|
||||||
|
evt.preventDefault();
|
||||||
this.results_show();
|
this.results_show();
|
||||||
}
|
}
|
||||||
return this.activate_field();
|
return this.activate_field();
|
||||||
|
|
|
@ -134,6 +134,7 @@ class Chosen
|
||||||
$(document).click @click_test_action
|
$(document).click @click_test_action
|
||||||
this.results_show()
|
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) is @selected_item || $(evt.target).parents("a.chzn-single").length)
|
||||||
|
evt.preventDefault()
|
||||||
this.results_show()
|
this.results_show()
|
||||||
|
|
||||||
this.activate_field()
|
this.activate_field()
|
||||||
|
@ -307,7 +308,6 @@ class Chosen
|
||||||
search_results_click: (evt) ->
|
search_results_click: (evt) ->
|
||||||
target = if $(evt.target).hasClass "active-result" then $(evt.target) else $(evt.target).parents(".active-result").first()
|
target = if $(evt.target).hasClass "active-result" then $(evt.target) else $(evt.target).parents(".active-result").first()
|
||||||
if target
|
if target
|
||||||
# TODO fix
|
|
||||||
@result_highlight = target
|
@result_highlight = target
|
||||||
this.result_select()
|
this.result_select()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue