Changed the way we use the setTimeout function. Should fix #403 #491 #492

pull/511/head
tidusjar 8 years ago
parent f63d729ee2
commit 9a31a51514

@ -56,7 +56,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(movieSearch, 800); searchTimer = setTimeout(function () {
movieSearch();
}.bind(this), 800);
}); });
@ -75,7 +77,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(tvSearch, 400); searchTimer = setTimeout(function() {
tvSearch();
}.bind(this), 800);
}); });
// Click TV dropdown option // Click TV dropdown option
@ -116,7 +120,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(musicSearch, 400); searchTimer = setTimeout(function () {
musicSearch();
}.bind(this), 800);
}); });

@ -8,6 +8,21 @@
return s; return s;
} }
Function.prototype.bind = function (parent) {
var f = this;
var args = [];
for (var a = 1; a < arguments.length; a++) {
args[args.length] = arguments[a];
}
var temp = function () {
return f.apply(parent, args);
}
return (temp);
}
$(function() { $(function() {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
}); });

Loading…
Cancel
Save