From 578b630cbaa4ace30ac1a2e170ac3dda3edd4294 Mon Sep 17 00:00:00 2001 From: jlukic Date: Sun, 23 Nov 2014 23:55:53 -0500 Subject: [PATCH] Cleanup code --- src/definitions/modules/dropdown.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 39b1915cc..cd94545e6 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -331,6 +331,7 @@ $.fn.dropdown = function(parameters) { $results = $(), exactRegExp = new RegExp('(?:\s|^)' + searchTerm, 'i'), fullTextRegExp = new RegExp(searchTerm, 'i'), + allItemsFiltered, $filteredItems ; $item @@ -358,7 +359,9 @@ $.fn.dropdown = function(parameters) { } }) ; - $filteredItems = $item.not($results); + $filteredItems = $item.not($results); + allItemsFiltered = ($filteredItems.size() == $item.size()); + module.remove.filteredItem(); module.remove.selectedItem(); $filteredItems @@ -369,7 +372,7 @@ $.fn.dropdown = function(parameters) { .eq(0) .addClass(className.selected) ; - if($filteredItems.size() == $item.size()) { + if(allItemsFiltered) { module.hide(); } },