From 1c183ef23b3c48b359c591b55d8d853ea15b4b9b Mon Sep 17 00:00:00 2001 From: Amanda Myer Date: Thu, 24 Jan 2013 11:09:30 -0500 Subject: [PATCH] Update select2.js --- select2.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/select2.js b/select2.js index 56688689..a8f3070e 100644 --- a/select2.js +++ b/select2.js @@ -2209,30 +2209,30 @@ the specific language governing permissions and limitations under the Apache Lic // multi postprocessResults: function () { var val = this.getVal(), - choices = this.results.find(".select2-result-selectable"), + choices = this.results.find(".select2-result:visible"), compound = this.results.find(".select2-result-with-children"), self = this; choices.each2(function (i, choice) { var id = self.id(choice.data("select2-data")); if (indexOf(id, val) >= 0) { - choice.addClass("select2-disabled").removeClass("select2-result-selectable"); + choice.addClass("select2-selected").removeClass("select2-result-selectable"); } else { - choice.removeClass("select2-disabled").addClass("select2-result-selectable"); + choice.removeClass("select2-selected").addClass("select2-result-selectable"); } }); compound.each2(function(i, e) { if (!e.is('.select2-result-selectable') && e.find(".select2-result-selectable").length==0) { // FIX FOR HIERARCHICAL DATA - e.addClass("select2-disabled"); + e.addClass("select2-selected"); } else { - e.removeClass("select2-disabled"); + e.removeClass("select2-selected"); } }); if (this.highlight() == -1){ choices.each2(function (i, choice) { - if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) { + if (!choice.hasClass("select2-selected") &&!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) { self.highlight(0); return false; }