10.3.x-maintenance
cTn 2014-03-09 03:11:11 +01:00
parent 1722ac5c18
commit ade74446b3
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ GUI_control.prototype.timeout_add = function(name, code, timeout) {
var timer = setTimeout(function() {
code(); // execute code
self.timeout_remove(name); // cleanup
// remove object from array
var index = self.timeout_array.indexOf(data);
if (index > -1) self.timeout_array.splice(index, 1);
}, timeout);
this.timeout_array.push({'name': name, 'timer': timer, 'timeout': timeout}); // push to primary timeout array