Make sure chosen doesn't stay "active" after form field becomes disabled.
This commit is contained in:
parent
6c6f3590bc
commit
85c436086f
|
@ -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);
|
||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue