1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00
This commit is contained in:
cTn 2014-03-09 03:11:11 +01:00
parent 1722ac5c18
commit ade74446b3

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