Allow to enable / disable running counters with a simple JS call

This commit is contained in:
Thomas Gelf 2014-03-09 18:01:38 +01:00
parent c7d3b38739
commit bd0c36ad7a
1 changed files with 19 additions and 1 deletions

View File

@ -17,13 +17,14 @@
this.debugTimer = null;
this.timeCounterTimer = null;
};
Icinga.UI.prototype = {
initialize: function () {
$('html').removeClass('no-js').addClass('js');
this.icinga.timer.register(this.refreshTimeSince, this, 1000);
this.enableTimeCounters();
this.triggerWindowResize();
this.fadeNotificationsAway();
},
@ -75,6 +76,21 @@
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 () {
var col1 = $('#col1 > div').detach();
var col2 = $('#col2 > div').detach();
@ -370,6 +386,8 @@
destroy: function () {
// This is gonna be hard, clean up the mess
this.icinga = null;
this.debugTimer = null;
this.timeCounterTimer = null;
}
};