From 6247674d714b487e66f1acee4740ed75df958645 Mon Sep 17 00:00:00 2001 From: Patrick Filler Date: Tue, 19 Jul 2011 15:59:08 -0400 Subject: [PATCH] Don't allow group name clicks in jQuery version. --- chosen/chosen.jquery.js | 2 +- coffee/chosen.jquery.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chosen/chosen.jquery.js b/chosen/chosen.jquery.js index dbd840a..3784ff2 100644 --- a/chosen/chosen.jquery.js +++ b/chosen/chosen.jquery.js @@ -340,7 +340,7 @@ Chosen.prototype.search_results_click = function(evt) { var target; target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); - if (target) { + if (target.length) { this.result_highlight = target; return this.result_select(); } diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 76442d0..5035e3f 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -297,7 +297,7 @@ class Chosen search_results_click: (evt) -> target = if $(evt.target).hasClass "active-result" then $(evt.target) else $(evt.target).parents(".active-result").first() - if target + if target.length @result_highlight = target this.result_select()