From 97ea2529c8911d389ee1a26cc6ae43ae7dbc54fb Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sat, 25 Mar 2017 08:40:40 +0500 Subject: Change "Mute" logic --- web/app/controller/Root.js | 8 ++++---- web/app/view/Map.js | 21 ++++----------------- 2 files changed, 8 insertions(+), 21 deletions(-) (limited to 'web/app') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index e8d4f0f..673f7fb 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -114,9 +114,9 @@ Ext.define('Traccar.controller.Root', { this.beepSound.play(); }, - mutePressed: function () { - var muteButton = Ext.getCmp('muteButton'); - return muteButton && !muteButton.pressed; + soundPressed: function () { + var soundButton = Ext.getCmp('soundButton'); + return soundButton && soundButton.pressed; }, removeUrlParameter: function (param) { @@ -231,7 +231,7 @@ Ext.define('Traccar.controller.Root', { } device = Ext.getStore('Devices').getById(array[i].deviceId); if (device) { - if (this.mutePressed()) { + if (this.soundPressed()) { this.beep(); } Ext.toast(text, device.get('name'), 'br'); diff --git a/web/app/view/Map.js b/web/app/view/Map.js index f9bb625..a3879ab 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -71,23 +71,10 @@ Ext.define('Traccar.view.Map', { stateId: 'device-follow-button', toggleHandler: 'onFollowClick' }, { - id: 'muteButton', - glyph: 'xf1f7@FontAwesome', - tooltip: Strings.sharedMute, - pressed: true, - stateId: 'mute-button', - listeners: { - toggle: function (button, pressed) { - if (pressed) { - button.setGlyph('xf1f7@FontAwesome'); - } else { - button.setGlyph('xf0a2@FontAwesome'); - } - } - }, - applyState: function (state) { - this.toggle(state.pressed); - } + id: 'soundButton', + glyph: 'xf0a2@FontAwesome', + tooltip: Strings.sharedSound, + stateId: 'sound-button' }, { xtype: 'settingsMenu', enableToggle: false -- cgit v1.2.3