aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Map.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-25 17:27:25 +1300
committerGitHub <noreply@github.com>2017-03-25 17:27:25 +1300
commitd68f47ef27eb6afc28444f2e7e0a8310ae4f25b5 (patch)
tree40ac870d42f129cd38bd43410cc7080cfdc3711c /web/app/view/Map.js
parent49eebb3a0d11e3c4d6f6951312e44bf65ce02906 (diff)
parentd1a21515aec2d8b6c0ecbc4ca10c54f594e4820e (diff)
downloadtrackermap-web-d68f47ef27eb6afc28444f2e7e0a8310ae4f25b5.tar.gz
trackermap-web-d68f47ef27eb6afc28444f2e7e0a8310ae4f25b5.tar.bz2
trackermap-web-d68f47ef27eb6afc28444f2e7e0a8310ae4f25b5.zip
Merge pull request #447 from Abyss777/save_state
Use cookies to save buttons state instead of User/Server attributes
Diffstat (limited to 'web/app/view/Map.js')
-rw-r--r--web/app/view/Map.js47
1 files changed, 21 insertions, 26 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index ebc6bbb0..a3879ab9 100644
--- a/web/app/view/Map.js
+++ b/web/app/view/Map.js
@@ -29,6 +29,15 @@ Ext.define('Traccar.view.Map', {
title: Strings.mapTitle,
tbar: {
componentCls: 'toolbar-header-style',
+ defaults: {
+ xtype: 'button',
+ tooltipType: 'title',
+ stateEvents: ['toggle'],
+ enableToggle: true,
+ stateful: {
+ pressed: true
+ }
+ },
items: [{
xtype: 'tbtext',
html: Strings.mapTitle,
@@ -36,53 +45,39 @@ Ext.define('Traccar.view.Map', {
}, {
xtype: 'tbfill'
}, {
- xtype: 'button',
- tooltipType: 'title',
handler: 'showReports',
reference: 'showReportsButton',
glyph: 'xf0f6@FontAwesome',
+ stateful: false,
+ enableToggle: false,
tooltip: Strings.reportTitle
}, {
- xtype: 'button',
- tooltipType: 'title',
handler: 'updateGeofences',
reference: 'showGeofencesButton',
glyph: 'xf21d@FontAwesome',
- enableToggle: true,
+ pressed: true,
+ stateId: 'show-geofences-button',
tooltip: Strings.sharedGeofences
}, {
- xtype: 'button',
- tooltipType: 'title',
handler: 'showLiveRoutes',
reference: 'showLiveRoutes',
glyph: 'xf1b0@FontAwesome',
- enableToggle: true,
+ stateId: 'show-live-routes-button',
tooltip: Strings.mapLiveRoutes
}, {
reference: 'deviceFollowButton',
glyph: 'xf05b@FontAwesome',
tooltip: Strings.deviceFollow,
- tooltipType: 'title',
- enableToggle: true,
+ stateId: 'device-follow-button',
toggleHandler: 'onFollowClick'
}, {
- id: 'muteButton',
- glyph: 'xf1f7@FontAwesome',
- tooltip: Strings.sharedMute,
- tooltipType: 'title',
- enableToggle: true,
- listeners: {
- toggle: function (button, pressed) {
- if (pressed) {
- button.setGlyph('xf1f7@FontAwesome');
- } else {
- button.setGlyph('xf0a2@FontAwesome');
- }
- },
- scope: this
- }
+ id: 'soundButton',
+ glyph: 'xf0a2@FontAwesome',
+ tooltip: Strings.sharedSound,
+ stateId: 'sound-button'
}, {
- xtype: 'settingsMenu'
+ xtype: 'settingsMenu',
+ enableToggle: false
}]
},