If field is disabled, stop destroy choice clicks as well.
This commit is contained in:
parent
805a60f4a5
commit
6c6f3590bc
7 changed files with 23 additions and 10 deletions
|
@ -311,6 +311,9 @@
|
|||
.chzn-disabled .chzn-single {
|
||||
cursor: default;
|
||||
}
|
||||
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* @group Right to Left */
|
||||
.chzn-rtl { direction:rtl;text-align: right; }
|
||||
|
|
|
@ -414,8 +414,12 @@
|
|||
};
|
||||
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
||||
evt.preventDefault();
|
||||
this.pending_destroy_click = true;
|
||||
return this.choice_destroy($(evt.target));
|
||||
if (!this.is_disabled) {
|
||||
this.pending_destroy_click = true;
|
||||
return this.choice_destroy($(evt.target));
|
||||
} else {
|
||||
return evt.stopPropagation;
|
||||
}
|
||||
};
|
||||
Chosen.prototype.choice_destroy = function(link) {
|
||||
this.choices -= 1;
|
||||
|
|
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
|
@ -404,8 +404,10 @@
|
|||
};
|
||||
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
||||
evt.preventDefault();
|
||||
this.pending_destroy_click = true;
|
||||
return this.choice_destroy(evt.target);
|
||||
if (!this.is_disabled) {
|
||||
this.pending_destroy_click = true;
|
||||
return this.choice_destroy(evt.target);
|
||||
}
|
||||
};
|
||||
Chosen.prototype.choice_destroy = function(link) {
|
||||
this.choices -= 1;
|
||||
|
|
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
|
@ -336,8 +336,11 @@ class Chosen
|
|||
|
||||
choice_destroy_link_click: (evt) ->
|
||||
evt.preventDefault()
|
||||
@pending_destroy_click = true
|
||||
this.choice_destroy $(evt.target)
|
||||
if not @is_disabled
|
||||
@pending_destroy_click = true
|
||||
this.choice_destroy $(evt.target)
|
||||
else
|
||||
evt.stopPropagation
|
||||
|
||||
choice_destroy: (link) ->
|
||||
@choices -= 1
|
||||
|
|
|
@ -333,8 +333,9 @@ class Chosen
|
|||
|
||||
choice_destroy_link_click: (evt) ->
|
||||
evt.preventDefault()
|
||||
@pending_destroy_click = true
|
||||
this.choice_destroy evt.target
|
||||
if not @is_disabled
|
||||
@pending_destroy_click = true
|
||||
this.choice_destroy evt.target
|
||||
|
||||
choice_destroy: (link) ->
|
||||
@choices -= 1
|
||||
|
|
Loading…
Reference in a new issue