From 5cee8ff9276c7c2e00c0f20fd6aa74628e1cb684 Mon Sep 17 00:00:00 2001 From: "Dario Javier Cravero (atlas)" Date: Wed, 3 Nov 2010 12:17:34 +0000 Subject: [PATCH] Fixed filtering to work with optgroup --- src/jquery.multiselect.filter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jquery.multiselect.filter.js b/src/jquery.multiselect.filter.js index 7aa7e77..326d7db 100644 --- a/src/jquery.multiselect.filter.js +++ b/src/jquery.multiselect.filter.js @@ -92,14 +92,13 @@ }, updateCache: function(){ - var optiontags = this.element.children(), - isOptgroup = optiontags[0].tagName === "OPTGROUP" || false; + var optiontags = this.element.children(); this.cache = optiontags.map(function(){ var self = $(this); // account for optgroups - if( isOptgroup ){ + if( this.tagName === "OPTGROUP" ){ self = self.children(); }