1
0
mirror of synced 2024-11-22 13:06:08 +03:00

fix ie8 compat, closes #7

This commit is contained in:
Igor Vaynberg 2012-03-29 10:45:31 -07:00
parent 1ab192ac7b
commit 341a3cd8b5

View File

@ -129,7 +129,7 @@
function installDebouncedScroll(threshold, element) { function installDebouncedScroll(threshold, element) {
var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);}); var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
element.on("scroll", function (e) { element.on("scroll", function (e) {
if (element.get().indexOf(e.target) >= 0) notify(e); if (indexOf(e.target, element.get()) >= 0) notify(e);
}); });
} }
@ -451,7 +451,7 @@
var choices = this.results.children(".select2-result"); var choices = this.results.children(".select2-result");
if (arguments.length === 0) { if (arguments.length === 0) {
return choices.get().indexOf(choices.filter(".select2-highlighted")[0]); return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
} }
choices.removeClass("select2-highlighted"); choices.removeClass("select2-highlighted");
@ -758,8 +758,8 @@
// hide the search box if this is the first we got the results and there are a few of them // hide the search box if this is the first we got the results and there are a few of them
if (initial===true) { if (initial === true) {
this.search.toggle(data.results.length>=this.opts.minimumResultsForSearch); this.search.toggle(data.results.length >= this.opts.minimumResultsForSearch);
} }
}; };
@ -1138,7 +1138,7 @@
select2.init(opts); select2.init(opts);
} else if (typeof(args[0]) === "string") { } else if (typeof(args[0]) === "string") {
if (allowedMethods.indexOf(args[0]) < 0) { if (indexOf(args[0], allowedMethods) < 0) {
throw "Unknown method: " + args[0]; throw "Unknown method: " + args[0];
} }