Skip to content

Commit 1fff478

Browse files
compress getContainerWidth(), add missing semicolon.
1 parent 55a257d commit 1fff478

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

select2.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@
341341
// if text is not a function we assume it to be a key name
342342
if (!$.isFunction(text)) text = function (item) { return item[data.text]; };
343343
data = data.results;
344-
}
344+
}
345345

346346
return function (query) {
347347
var t = query.term.toUpperCase(), filtered = {};
348348
if (t === "") {
349349
query.callback({results: data});
350350
return;
351-
}
351+
}
352352
filtered.result = $(data)
353353
.filter(function () {return text(this).toUpperCase().indexOf(t) >= 0;})
354354
.get();
@@ -609,13 +609,11 @@
609609
for (var i = 0; i < attrs.length; i++) {
610610
var matches = attrs[i].replace(/\s/g,'')
611611
.match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);
612-
if(matches == null || matches.length < 1)
613-
continue;
612+
if(matches != null && matches.length >= 1)
614613
return matches[1];
615614
}
616-
617615
return this.opts.element.width();
618-
}
616+
};
619617

620618

621619
function SingleSelect2() {

0 commit comments

Comments
 (0)