diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-21 17:48:08 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-21 18:05:28 +0500 |
commit | b9fda5b5d6630fec90b263a0dbcdcdaf24ed43e7 (patch) | |
tree | 372b47bd8f30216f9eb369a885e76e67378eb979 /web/app/view/MapPickerDialogController.js | |
parent | 19d6e1c9cc916ed4c1ed72fe168909770a657db2 (diff) | |
download | trackermap-web-b9fda5b5d6630fec90b263a0dbcdcdaf24ed43e7.tar.gz trackermap-web-b9fda5b5d6630fec90b263a0dbcdcdaf24ed43e7.tar.bz2 trackermap-web-b9fda5b5d6630fec90b263a0dbcdcdaf24ed43e7.zip |
Save toggles state in user/server attributes
Diffstat (limited to 'web/app/view/MapPickerDialogController.js')
-rw-r--r-- | web/app/view/MapPickerDialogController.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/web/app/view/MapPickerDialogController.js b/web/app/view/MapPickerDialogController.js index 1dc48ea0..6a3b1a51 100644 --- a/web/app/view/MapPickerDialogController.js +++ b/web/app/view/MapPickerDialogController.js @@ -24,7 +24,8 @@ Ext.define('Traccar.view.MapPickerDialogController', { listen: { controller: { '*': { - mapstate: 'setMapState' + mapstate: 'setMapState', + togglestate: 'setToggleState' } } } @@ -34,9 +35,18 @@ Ext.define('Traccar.view.MapPickerDialogController', { this.fireEvent('mapstaterequest'); }, + getToggleState: function (button) { + this.fireEvent('togglestaterequest'); + }, + setMapState: function (lat, lon, zoom) { this.lookupReference('latitude').setValue(lat); this.lookupReference('longitude').setValue(lon); this.lookupReference('zoom').setValue(zoom); + }, + + setToggleState: function (state) { + var record = this.getView().down('form').getRecord(); + record.set('attributes', Ext.merge(record.get('attributes'), state)); } }); |