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 {
|
.chzn-disabled .chzn-single {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
/* @group Right to Left */
|
/* @group Right to Left */
|
||||||
.chzn-rtl { direction:rtl;text-align: right; }
|
.chzn-rtl { direction:rtl;text-align: right; }
|
||||||
|
|
|
@ -414,8 +414,12 @@
|
||||||
};
|
};
|
||||||
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
this.pending_destroy_click = true;
|
if (!this.is_disabled) {
|
||||||
return this.choice_destroy($(evt.target));
|
this.pending_destroy_click = true;
|
||||||
|
return this.choice_destroy($(evt.target));
|
||||||
|
} else {
|
||||||
|
return evt.stopPropagation;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Chosen.prototype.choice_destroy = function(link) {
|
Chosen.prototype.choice_destroy = function(link) {
|
||||||
this.choices -= 1;
|
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) {
|
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
this.pending_destroy_click = true;
|
if (!this.is_disabled) {
|
||||||
return this.choice_destroy(evt.target);
|
this.pending_destroy_click = true;
|
||||||
|
return this.choice_destroy(evt.target);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Chosen.prototype.choice_destroy = function(link) {
|
Chosen.prototype.choice_destroy = function(link) {
|
||||||
this.choices -= 1;
|
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) ->
|
choice_destroy_link_click: (evt) ->
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
@pending_destroy_click = true
|
if not @is_disabled
|
||||||
this.choice_destroy $(evt.target)
|
@pending_destroy_click = true
|
||||||
|
this.choice_destroy $(evt.target)
|
||||||
|
else
|
||||||
|
evt.stopPropagation
|
||||||
|
|
||||||
choice_destroy: (link) ->
|
choice_destroy: (link) ->
|
||||||
@choices -= 1
|
@choices -= 1
|
||||||
|
|
|
@ -333,8 +333,9 @@ class Chosen
|
||||||
|
|
||||||
choice_destroy_link_click: (evt) ->
|
choice_destroy_link_click: (evt) ->
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
@pending_destroy_click = true
|
if not @is_disabled
|
||||||
this.choice_destroy evt.target
|
@pending_destroy_click = true
|
||||||
|
this.choice_destroy evt.target
|
||||||
|
|
||||||
choice_destroy: (link) ->
|
choice_destroy: (link) ->
|
||||||
@choices -= 1
|
@choices -= 1
|
||||||
|
|
Loading…
Reference in a new issue