Allow to enable / disable running counters with a simple JS call
This commit is contained in:
parent
c7d3b38739
commit
bd0c36ad7a
|
@ -17,13 +17,14 @@
|
||||||
|
|
||||||
this.debugTimer = null;
|
this.debugTimer = null;
|
||||||
|
|
||||||
|
this.timeCounterTimer = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
Icinga.UI.prototype = {
|
Icinga.UI.prototype = {
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
$('html').removeClass('no-js').addClass('js');
|
$('html').removeClass('no-js').addClass('js');
|
||||||
this.icinga.timer.register(this.refreshTimeSince, this, 1000);
|
this.enableTimeCounters();
|
||||||
this.triggerWindowResize();
|
this.triggerWindowResize();
|
||||||
this.fadeNotificationsAway();
|
this.fadeNotificationsAway();
|
||||||
},
|
},
|
||||||
|
@ -75,6 +76,21 @@
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
enableTimeCounters: function () {
|
||||||
|
this.timeCounterTimer = this.icinga.timer.register(
|
||||||
|
this.refreshTimeSince,
|
||||||
|
this,
|
||||||
|
1000
|
||||||
|
);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
disableTimeCounters: function () {
|
||||||
|
this.icinga.timer.unregister(this.timeCounterTimer);
|
||||||
|
this.timeCounterTimer = null;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
flipContent: function () {
|
flipContent: function () {
|
||||||
var col1 = $('#col1 > div').detach();
|
var col1 = $('#col1 > div').detach();
|
||||||
var col2 = $('#col2 > div').detach();
|
var col2 = $('#col2 > div').detach();
|
||||||
|
@ -370,6 +386,8 @@
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
// This is gonna be hard, clean up the mess
|
// This is gonna be hard, clean up the mess
|
||||||
this.icinga = null;
|
this.icinga = null;
|
||||||
|
this.debugTimer = null;
|
||||||
|
this.timeCounterTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue