diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 18:23:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 18:23:32 +1300 |
commit | 99d132dc78b42b6cc5833b3a7faf30d2fe56186f (patch) | |
tree | 045052b15478c32c44f36a07c70885a756ea19b3 /web/app/view/CommandDialogController.js | |
parent | dcfe1d48998c3fb3baa704fafed43d996f329a07 (diff) | |
download | traccar-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.gz traccar-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.bz2 traccar-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.zip |
Disable JavaScript strict mode
Diffstat (limited to 'web/app/view/CommandDialogController.js')
-rw-r--r-- | web/app/view/CommandDialogController.js | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js index 39149c5a5..94df2ec42 100644 --- a/web/app/view/CommandDialogController.js +++ b/web/app/view/CommandDialogController.js @@ -13,49 +13,45 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function () { - 'use strict'; - - Ext.define('Traccar.view.CommandDialogController', { - extend: 'Ext.app.ViewController', - alias: 'controller.commandDialog', - - onSelect: function (selected) { - this.lookupReference('paramPositionPeriodic').setHidden( - selected.getValue() !== 'positionPeriodic'); - }, - - onSendClick: function (button) { - var attributes, value, record, form; - - form = button.up('window').down('form'); - form.updateRecord(); - record = form.getRecord(); - - if (record.get('type') === 'positionPeriodic') { - attributes = this.lookupReference('paramPositionPeriodic'); - value = attributes.down('numberfield[name="frequency"]').getValue(); - value *= attributes.down('combobox[name="unit"]').getValue(); - - record.set('attributes', { - frequency: value - }); - } - - Ext.Ajax.request({ - scope: this, - url: '/api/command/send', - jsonData: record.getData(), - callback: this.onSendResult - }); - }, - onSendResult: function (options, success, response) { - if (Traccar.ErrorManager.check(success, response)) { - Ext.toast(Strings.commandSent); - this.closeView(); - } +Ext.define('Traccar.view.CommandDialogController', { + extend: 'Ext.app.ViewController', + alias: 'controller.commandDialog', + + onSelect: function (selected) { + this.lookupReference('paramPositionPeriodic').setHidden( + selected.getValue() !== 'positionPeriodic'); + }, + + onSendClick: function (button) { + var attributes, value, record, form; + + form = button.up('window').down('form'); + form.updateRecord(); + record = form.getRecord(); + + if (record.get('type') === 'positionPeriodic') { + attributes = this.lookupReference('paramPositionPeriodic'); + value = attributes.down('numberfield[name="frequency"]').getValue(); + value *= attributes.down('combobox[name="unit"]').getValue(); + + record.set('attributes', { + frequency: value + }); } - }); -})(); + Ext.Ajax.request({ + scope: this, + url: '/api/command/send', + jsonData: record.getData(), + callback: this.onSendResult + }); + }, + + onSendResult: function (options, success, response) { + if (Traccar.ErrorManager.check(success, response)) { + Ext.toast(Strings.commandSent); + this.closeView(); + } + } +}); |