diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 21:01:45 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 21:01:45 +1300 |
commit | 48f981a2a9755fb0af6497020e499bb0883e0e1f (patch) | |
tree | ac960f950e4f37aec2614a97a706aed34a1fb2db /web/app/view/ReportController.js | |
parent | d16121684ecae7646aa87616a64d60978d087bc0 (diff) | |
download | trackermap-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.tar.gz trackermap-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.tar.bz2 trackermap-server-48f981a2a9755fb0af6497020e499bb0883e0e1f.zip |
Enable JavaScript strict mode
Diffstat (limited to 'web/app/view/ReportController.js')
-rw-r--r-- | web/app/view/ReportController.js | 104 |
1 files changed, 54 insertions, 50 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 99c1a9b07..8653784ab 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -13,68 +13,72 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +(function () { + 'use strict'; -Ext.define('Traccar.view.ReportController', { - extend: 'Ext.app.ViewController', - alias: 'controller.report', + Ext.define('Traccar.view.ReportController', { + extend: 'Ext.app.ViewController', + alias: 'controller.report', - config: { - listen: { - controller: { - '*': { - selectDevice: 'selectDevice' + config: { + listen: { + controller: { + '*': { + selectDevice: 'selectDevice' + } } } - } - }, + }, - onShowClick: function () { - var deviceId, fromDate, fromTime, from, toDate, toTime, to, store; + onShowClick: function () { + var deviceId, fromDate, fromTime, from, toDate, toTime, to, store; - deviceId = this.lookupReference('deviceField').getValue(); + deviceId = this.lookupReference('deviceField').getValue(); - fromDate = this.lookupReference('fromDateField').getValue(); - fromTime = this.lookupReference('fromTimeField').getValue(); + fromDate = this.lookupReference('fromDateField').getValue(); + fromTime = this.lookupReference('fromTimeField').getValue(); - from = new Date( - fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(), - fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds()); + from = new Date( + fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(), + fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds()); - toDate = this.lookupReference('toDateField').getValue(); - toTime = this.lookupReference('toTimeField').getValue(); + toDate = this.lookupReference('toDateField').getValue(); + toTime = this.lookupReference('toTimeField').getValue(); - to = new Date( - toDate.getFullYear(), toDate.getMonth(), toDate.getDate(), - toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds()); + to = new Date( + toDate.getFullYear(), toDate.getMonth(), toDate.getDate(), + toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds()); - store = Ext.getStore('Positions'); - store.load({ - params:{ - deviceId: deviceId, - from: from.toISOString(), - to: to.toISOString() - }, - scope: this, - callback: function () { - this.fireEvent("reportShow"); - } - }); - }, + store = Ext.getStore('Positions'); + store.load({ + params: { + deviceId: deviceId, + from: from.toISOString(), + to: to.toISOString() + }, + scope: this, + callback: function () { + this.fireEvent("reportShow"); + } + }); + }, - onClearClick: function () { - Ext.getStore('Positions').removeAll(); - this.fireEvent("reportClear"); - }, + onClearClick: function () { + Ext.getStore('Positions').removeAll(); + this.fireEvent("reportClear"); + }, - onSelectionChange: function (selected) { - if (selected.getCount() > 0) { - this.fireEvent("selectReport", selected.getLastSelected()); - } - }, + onSelectionChange: function (selected) { + if (selected.getCount() > 0) { + this.fireEvent("selectReport", selected.getLastSelected()); + } + }, - selectDevice: function (device) { - if (device !== undefined) { - this.getView().getSelectionModel().deselectAll(); + selectDevice: function (device) { + if (device !== undefined) { + this.getView().getSelectionModel().deselectAll(); + } } - } -}); + }); + +})(); |