Fix focus issues caused by bad indenting.

abstract-chosen
Patrick Filler 2011-07-08 16:52:18 -04:00
parent fecd7e24a5
commit a723721b65
2 changed files with 22 additions and 22 deletions

View File

@ -141,20 +141,20 @@
Chosen.prototype.container_click = function(evt) {
if (evt && evt.type === "click") {
evt.stop();
if (!this.pending_destroy_click) {
if (!this.active_field) {
if (this.is_multiple) {
this.search_field.clear();
}
document.observe("click", this.click_test_action);
this.results_show();
} else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chzn-single"))) {
this.results_show();
}
if (!this.pending_destroy_click) {
if (!this.active_field) {
if (this.is_multiple) {
this.search_field.clear();
}
return this.activate_field();
} else {
return this.pending_destroy_click = false;
document.observe("click", this.click_test_action);
this.results_show();
} else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chzn-single"))) {
this.results_show();
}
return this.activate_field();
} else {
return this.pending_destroy_click = false;
}
};
Chosen.prototype.mouse_enter = function() {

View File

@ -124,17 +124,17 @@ class Chosen
container_click: (evt) ->
if evt and evt.type is "click"
evt.stop()
if not @pending_destroy_click
if not @active_field
@search_field.clear() if @is_multiple
document.observe "click", @click_test_action
this.results_show()
else if not @is_multiple and evt and (evt.target is @selected_item || evt.target.up("a.chzn-single"))
this.results_show()
if not @pending_destroy_click
if not @active_field
@search_field.clear() if @is_multiple
document.observe "click", @click_test_action
this.results_show()
else if not @is_multiple and evt and (evt.target is @selected_item || evt.target.up("a.chzn-single"))
this.results_show()
this.activate_field()
else
@pending_destroy_click = false
this.activate_field()
else
@pending_destroy_click = false
mouse_enter: -> @mouse_on_container = true
mouse_leave: -> @mouse_on_container = false