diff --git a/ucs-school-umc-exam/umc/js/schoolexam/RebootGrid.js b/ucs-school-umc-exam/umc/js/schoolexam/RebootGrid.js index 5d1cfb121..79873a0dc 100644 --- a/ucs-school-umc-exam/umc/js/schoolexam/RebootGrid.js +++ b/ucs-school-umc-exam/umc/js/schoolexam/RebootGrid.js @@ -49,6 +49,7 @@ define([ _lastUpdate: 0, _firstUpdate: 0, _updateTimer: null, + _autoUpdate: false, teacherIPs: null, constructor: function() { @@ -126,6 +127,7 @@ define([ this._lastUpdate = new Date(); this._firstUpdate = new Date(); // this.standby(true); + this._autoUpdate = true; this._updateRooms(); })); }))); @@ -179,7 +181,9 @@ define([ _updateRooms: function() { var update = function() { - this._updateTimer = window.setTimeout(lang.hitch(this, '_updateRooms'), 1000); + if (this._autoUpdate) { + this._updateTimer = window.setTimeout(lang.hitch(this, '_updateRooms'), 1000); + } }; this.umcpCommand('computerroom/update', {}, false).then(lang.hitch(this, function(response) { @@ -216,6 +220,7 @@ define([ uninitialize: function() { this.inherited(arguments); + this._autoUpdate = false; if (this._updateTimer !== null) { window.clearTimeout(this._updateTimer); }