mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
parent
80d3abed9d
commit
cb2093513a
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
|
|
||||||
this.lastRuntime = [];
|
this.lastRuntime = [];
|
||||||
|
|
||||||
|
this.isRunning = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Icinga.Timer.prototype = {
|
Icinga.Timer.prototype = {
|
||||||
@ -49,8 +51,16 @@
|
|||||||
* The initialization function starts our ticker
|
* The initialization function starts our ticker
|
||||||
*/
|
*/
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
|
this.isRunning = true;
|
||||||
|
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.ticker = setInterval(function () { _this.tick(); }, this.interval);
|
var f = function () {
|
||||||
|
if (_this.isRunning) {
|
||||||
|
_this.tick();
|
||||||
|
setTimeout(f, _this.interval);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
f();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,10 +122,7 @@
|
|||||||
* Our destroy function will clean up everything. Unused right now.
|
* Our destroy function will clean up everything. Unused right now.
|
||||||
*/
|
*/
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
|
this.isRunning = false;
|
||||||
if (this.ticker !== null) {
|
|
||||||
clearInterval(this.ticker);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.icinga = null;
|
this.icinga = null;
|
||||||
$.each(this.observers, function (idx, observer) {
|
$.each(this.observers, function (idx, observer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user