Make sure chosen doesn't stay "active" after form field becomes disabled.

This commit is contained in:
Patrick Filler 2011-09-23 10:08:22 -05:00
parent 6c6f3590bc
commit 85c436086f
6 changed files with 8 additions and 4 deletions

View file

@ -145,8 +145,9 @@
this.container.addClass('chzn-disabled');
this.search_field.attr('disabled', true);
if (!this.is_multiple) {
return this.selected_item.unbind("focus", this.activate_action);
this.selected_item.unbind("focus", this.activate_action);
}
return this.close_field();
} else {
this.container.removeClass('chzn-disabled');
this.search_field.attr('disabled', false);

File diff suppressed because one or more lines are too long

View file

@ -136,8 +136,9 @@
this.container.addClassName('chzn-disabled');
this.search_field.disabled = true;
if (!this.is_multiple) {
return this.selected_item.stopObserving("focus", this.activate_action);
this.selected_item.stopObserving("focus", this.activate_action);
}
return this.close_field();
} else {
this.container.removeClassName('chzn-disabled');
this.search_field.disabled = false;

File diff suppressed because one or more lines are too long

View file

@ -113,6 +113,7 @@ class Chosen
@container.addClass 'chzn-disabled'
@search_field.attr 'disabled', true
@selected_item.unbind "focus", @activate_action if !@is_multiple
this.close_field()
else
@container.removeClass 'chzn-disabled'
@search_field.attr 'disabled', false

View file

@ -108,6 +108,7 @@ class Chosen
@container.addClassName 'chzn-disabled'
@search_field.disabled = true
@selected_item.stopObserving "focus", @activate_action if !@is_multiple
this.close_field()
else
@container.removeClassName 'chzn-disabled'
@search_field.disabled = false