1
0
mirror of synced 2025-02-03 21:59:24 +03:00

better handling of non-numeric ids

This commit is contained in:
Igor Vaynberg 2012-03-30 21:25:38 -07:00
parent 26982e1952
commit 40843b1b98

View File

@ -764,7 +764,7 @@
// find the selected element in the result list
this.results.find(".select2-result").each(function (i) {
if ($(this).data("select2-data").id === self.opts.element.val()) {
if (equal($(this).data("select2-data").id, self.opts.element.val())) {
selected = i;
return false;
}
@ -1062,7 +1062,7 @@
choices.each(function () {
var choice = $(this), id = choice.data("select2-data").id;
if (val.indexOf(id) >= 0) {
if (indexOf(id, val) >= 0) {
choice.addClass("select2-disabled");
} else {
choice.removeClass("select2-disabled");