From e4a8f088435f63ee2b6e680d6a7453e0eb75c09b Mon Sep 17 00:00:00 2001 From: Patrick Filler Date: Wed, 20 Jul 2011 10:44:23 -0400 Subject: [PATCH] Change a couple of prototype-style references into jQuery references. Fixes group display on search and deselect issues. --- chosen/chosen.jquery.js | 4 ++-- coffee/chosen.jquery.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chosen/chosen.jquery.js b/chosen/chosen.jquery.js index f335fe5..f76aa7c 100644 --- a/chosen/chosen.jquery.js +++ b/chosen/chosen.jquery.js @@ -427,7 +427,7 @@ result_data = this.results_data[pos]; result_data.selected = false; this.form_field.options[result_data.options_index].selected = false; - result = $(this.form_field.id + "chzn_o_" + pos); + result = $("#" + this.form_field.id + "chzn_o_" + pos); result.removeClass("result-selected").addClass("active-result").show(); this.result_clear_highlight(); this.winnow_results(); @@ -454,7 +454,7 @@ option = _ref[_i]; if (!option.disabled && !option.empty) { if (option.group) { - $(option.dom_id).hide(); + $('#' + option.dom_id).hide(); } else if (!(this.is_multiple && option.selected)) { found = false; result_id = option.dom_id; diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index ac46594..54d3c89 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -379,7 +379,7 @@ class Chosen result_data.selected = false @form_field.options[result_data.options_index].selected = false - result = $(@form_field.id + "chzn_o_" + pos) + result = $("#" + @form_field.id + "chzn_o_" + pos) result.removeClass("result-selected").addClass("active-result").show() this.result_clear_highlight() @@ -407,7 +407,7 @@ class Chosen for option in @results_data if not option.disabled and not option.empty if option.group - $(option.dom_id).hide() + $('#' + option.dom_id).hide() else if not (@is_multiple and option.selected) found = false result_id = option.dom_id