aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/MapPickerDialogController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/MapPickerDialogController.js')
-rw-r--r--web/app/view/MapPickerDialogController.js12
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));
}
});