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

This commit is contained in:
tidusjar 2016-08-24 12:34:39 +01:00
commit 9a31a51514
2 changed files with 24 additions and 3 deletions

View file

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

View file

@ -8,6 +8,21 @@
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() {
$('[data-toggle="tooltip"]').tooltip();
});