From 1fff4788ebc8f844acf98c99e95ba4ad6b322e85 Mon Sep 17 00:00:00 2001 From: Justin DuJardin Date: Wed, 28 Mar 2012 10:33:53 -0700 Subject: [PATCH] compress getContainerWidth(), add missing semicolon. --- select2.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/select2.js b/select2.js index 63655757..81b9c50f 100755 --- a/select2.js +++ b/select2.js @@ -341,14 +341,14 @@ // if text is not a function we assume it to be a key name if (!$.isFunction(text)) text = function (item) { return item[data.text]; }; data = data.results; - } + } return function (query) { var t = query.term.toUpperCase(), filtered = {}; if (t === "") { query.callback({results: data}); return; - } + } filtered.result = $(data) .filter(function () {return text(this).toUpperCase().indexOf(t) >= 0;}) .get(); @@ -609,13 +609,11 @@ for (var i = 0; i < attrs.length; i++) { var matches = attrs[i].replace(/\s/g,'') .match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/); - if(matches == null || matches.length < 1) - continue; + if(matches != null && matches.length >= 1) return matches[1]; } - return this.opts.element.width(); - } + }; function SingleSelect2() {