fix tracking of results under mouse. fixes #258
This commit is contained in:
parent
e620b54271
commit
b3089218dc
17
select2.js
17
select2.js
@ -1891,20 +1891,29 @@
|
|||||||
postprocessResults: function () {
|
postprocessResults: function () {
|
||||||
var val = this.getVal(),
|
var val = this.getVal(),
|
||||||
choices = this.results.find(".select2-result-selectable"),
|
choices = this.results.find(".select2-result-selectable"),
|
||||||
|
compound = this.results.find(".select2-result-with-children"),
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
choices.each2(function (i, choice) {
|
choices.each2(function (i, choice) {
|
||||||
var id = self.id(choice.data("select2-data"));
|
var id = self.id(choice.data("select2-data"));
|
||||||
if (indexOf(id, val) >= 0) {
|
if (indexOf(id, val) >= 0) {
|
||||||
choice.addClass("select2-disabled");
|
choice.addClass("select2-disabled").removeClass("select2-result-selectable");
|
||||||
} else {
|
} else {
|
||||||
choice.removeClass("select2-disabled");
|
choice.removeClass("select2-disabled").addClass("select2-result-selectable");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
compound.each2(function(i, e) {
|
||||||
|
if (e.find(".select2-result-selectable").length==0) {
|
||||||
|
e.addClass("select2-disabled");
|
||||||
|
} else {
|
||||||
|
e.removeClass("select2-disabled");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
choices.each2(function (i, choice) {
|
choices.each2(function (i, choice) {
|
||||||
if (!choice.hasClass("select2-disabled")) {
|
if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) {
|
||||||
self.highlight(i);
|
self.highlight(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user