aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Map.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/Map.js')
-rw-r--r--web/app/view/Map.js38
1 files changed, 23 insertions, 15 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js
index ebc6bbb0..f9bb6250 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,41 +45,37 @@ 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,
+ pressed: true,
+ stateId: 'mute-button',
listeners: {
toggle: function (button, pressed) {
if (pressed) {
@@ -78,11 +83,14 @@ Ext.define('Traccar.view.Map', {
} else {
button.setGlyph('xf0a2@FontAwesome');
}
- },
- scope: this
+ }
+ },
+ applyState: function (state) {
+ this.toggle(state.pressed);
}
}, {
- xtype: 'settingsMenu'
+ xtype: 'settingsMenu',
+ enableToggle: false
}]
},