diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-26 12:28:03 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-26 12:28:03 +1200 |
commit | cfa8225c8298fd933d92f62928edbd1f6f9096fc (patch) | |
tree | 0b9792071a84ccaab8716b3b4abb46694d6aeff7 /web/app/view/command/CommandDialogController.js | |
parent | 430528f29c0b572770ec43f43ac285a354ba08de (diff) | |
download | trackermap-server-cfa8225c8298fd933d92f62928edbd1f6f9096fc.tar.gz trackermap-server-cfa8225c8298fd933d92f62928edbd1f6f9096fc.tar.bz2 trackermap-server-cfa8225c8298fd933d92f62928edbd1f6f9096fc.zip |
Extra parameters for commands
Diffstat (limited to 'web/app/view/command/CommandDialogController.js')
-rw-r--r-- | web/app/view/command/CommandDialogController.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/web/app/view/command/CommandDialogController.js b/web/app/view/command/CommandDialogController.js index 08624bf73..14d4ba2e0 100644 --- a/web/app/view/command/CommandDialogController.js +++ b/web/app/view/command/CommandDialogController.js @@ -18,10 +18,25 @@ Ext.define('Traccar.view.command.CommandDialogController', { extend: 'Ext.app.ViewController', alias: 'controller.commanddialog', + onSelect: function(selected) { + this.lookupReference('paramPositionFix').setHidden(selected.getValue() !== 'positionFix'); + }, + onSendClick: function(button) { - var dialog = button.up('window').down('form'); - dialog.updateRecord(); - var record = dialog.getRecord(); + var other; + var form = button.up('window').down('form'); + form.updateRecord(); + var record = form.getRecord(); + + if (record.get('type') === 'positionFix') { + other = this.lookupReference('paramPositionFix'); + var value = other.down('numberfield[name="frequency"]').getValue(); + value *= other.down('combobox[name="unit"]').getValue(); + + record.set('other', { + frequency: value + }); + } Ext.Ajax.request({ scope: this, |