|
Lines 49-54
define([
Link Here
|
| 49 |
_lastUpdate: 0, |
49 |
_lastUpdate: 0, |
| 50 |
_firstUpdate: 0, |
50 |
_firstUpdate: 0, |
| 51 |
_updateTimer: null, |
51 |
_updateTimer: null, |
|
|
52 |
_autoUpdate: false, |
| 52 |
teacherIPs: null, |
53 |
teacherIPs: null, |
| 53 |
|
54 |
|
| 54 |
constructor: function() { |
55 |
constructor: function() { |
|
Lines 126-131
define([
Link Here
|
| 126 |
this._lastUpdate = new Date(); |
127 |
this._lastUpdate = new Date(); |
| 127 |
this._firstUpdate = new Date(); |
128 |
this._firstUpdate = new Date(); |
| 128 |
// this.standby(true); |
129 |
// this.standby(true); |
|
|
130 |
this._autoUpdate = true; |
| 129 |
this._updateRooms(); |
131 |
this._updateRooms(); |
| 130 |
})); |
132 |
})); |
| 131 |
}))); |
133 |
}))); |
|
Lines 179-185
define([
Link Here
|
| 179 |
|
181 |
|
| 180 |
_updateRooms: function() { |
182 |
_updateRooms: function() { |
| 181 |
var update = function() { |
183 |
var update = function() { |
| 182 |
this._updateTimer = window.setTimeout(lang.hitch(this, '_updateRooms'), 1000); |
184 |
if (this._autoUpdate) { |
|
|
185 |
this._updateTimer = window.setTimeout(lang.hitch(this, '_updateRooms'), 1000); |
| 186 |
} |
| 183 |
}; |
187 |
}; |
| 184 |
|
188 |
|
| 185 |
this.umcpCommand('computerroom/update', {}, false).then(lang.hitch(this, function(response) { |
189 |
this.umcpCommand('computerroom/update', {}, false).then(lang.hitch(this, function(response) { |
|
Lines 216-221
define([
Link Here
|
| 216 |
|
220 |
|
| 217 |
uninitialize: function() { |
221 |
uninitialize: function() { |
| 218 |
this.inherited(arguments); |
222 |
this.inherited(arguments); |
|
|
223 |
this._autoUpdate = false; |
| 219 |
if (this._updateTimer !== null) { |
224 |
if (this._updateTimer !== null) { |
| 220 |
window.clearTimeout(this._updateTimer); |
225 |
window.clearTimeout(this._updateTimer); |
| 221 |
} |
226 |
} |