Skip to content

Commit 341a3cd

Browse files
committed
fix ie8 compat, closes select2#7
1 parent 1ab192a commit 341a3cd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

select2.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
function installDebouncedScroll(threshold, element) {
130130
var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
131131
element.on("scroll", function (e) {
132-
if (element.get().indexOf(e.target) >= 0) notify(e);
132+
if (indexOf(e.target, element.get()) >= 0) notify(e);
133133
});
134134
}
135135

@@ -451,7 +451,7 @@
451451
var choices = this.results.children(".select2-result");
452452

453453
if (arguments.length === 0) {
454-
return choices.get().indexOf(choices.filter(".select2-highlighted")[0]);
454+
return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
455455
}
456456

457457
choices.removeClass("select2-highlighted");
@@ -758,8 +758,8 @@
758758

759759
// hide the search box if this is the first we got the results and there are a few of them
760760

761-
if (initial===true) {
762-
this.search.toggle(data.results.length>=this.opts.minimumResultsForSearch);
761+
if (initial === true) {
762+
this.search.toggle(data.results.length >= this.opts.minimumResultsForSearch);
763763
}
764764

765765
};
@@ -1138,7 +1138,7 @@
11381138
select2.init(opts);
11391139
} else if (typeof(args[0]) === "string") {
11401140

1141-
if (allowedMethods.indexOf(args[0]) < 0) {
1141+
if (indexOf(args[0], allowedMethods) < 0) {
11421142
throw "Unknown method: " + args[0];
11431143
}
11441144

0 commit comments

Comments
 (0)