aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/dialog
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-20 15:20:41 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-20 15:20:41 +0500
commitc16972a1f574189b9b21fc237336440cdba10f0d (patch)
tree33158a0fca300aac5013e23a7fce89eb3998e8d4 /web/app/view/dialog
parentadf79e9bc86bc485ea3fa02c4d25b11d8fffee1f (diff)
downloadtrackermap-web-c16972a1f574189b9b21fc237336440cdba10f0d.tar.gz
trackermap-web-c16972a1f574189b9b21fc237336440cdba10f0d.tar.bz2
trackermap-web-c16972a1f574189b9b21fc237336440cdba10f0d.zip
Move Device Distance to Device Menu
Diffstat (limited to 'web/app/view/dialog')
-rw-r--r--web/app/view/dialog/DeviceDistance.js12
-rw-r--r--web/app/view/dialog/DeviceDistanceController.js22
2 files changed, 6 insertions, 28 deletions
diff --git a/web/app/view/dialog/DeviceDistance.js b/web/app/view/dialog/DeviceDistance.js
index c6ac9f20..53945885 100644
--- a/web/app/view/dialog/DeviceDistance.js
+++ b/web/app/view/dialog/DeviceDistance.js
@@ -27,17 +27,6 @@ Ext.define('Traccar.view.dialog.DeviceDistance', {
title: Strings.sharedDeviceDistance,
items: [{
- xtype: 'combobox',
- reference: 'deviceId',
- fieldLabel: Strings.sharedDevice,
- store: 'AllDevices',
- displayField: 'name',
- valueField: 'id',
- editable: false,
- listeners: {
- change: 'onDeviceChange'
- }
- }, {
xtype: 'customNumberField',
dataType: 'distance',
reference: 'totalDistance',
@@ -45,7 +34,6 @@ Ext.define('Traccar.view.dialog.DeviceDistance', {
}],
buttons: [{
- disabled: true,
reference: 'setButton',
glyph: 'xf00c@FontAwesome',
tooltip: Strings.sharedSet,
diff --git a/web/app/view/dialog/DeviceDistanceController.js b/web/app/view/dialog/DeviceDistanceController.js
index bd9e059d..ae14f33c 100644
--- a/web/app/view/dialog/DeviceDistanceController.js
+++ b/web/app/view/dialog/DeviceDistanceController.js
@@ -20,21 +20,11 @@ Ext.define('Traccar.view.dialog.DeviceDistanceController', {
extend: 'Ext.app.ViewController',
alias: 'controller.deviceDistance',
- onDeviceChange: function (combobox, newValue) {
- var position;
- this.lookupReference('setButton').setDisabled(newValue === null);
- if (newValue) {
- position = Ext.getStore('LatestPositions').findRecord('deviceId', newValue, 0, false, false, true);
- if (position) {
- this.lookupReference('totalDistance').setValue(position.get('attributes').totalDistance);
- }
- }
- },
-
- onSetClick: function (button) {
- var data = {};
- data.deviceId = this.lookupReference('deviceId').getValue();
- data.totalDistance = this.lookupReference('totalDistance').getValue();
+ onSetClick: function () {
+ var data = {
+ deviceId: this.getView().deviceId,
+ totalDistance: this.lookupReference('totalDistance').getValue()
+ };
Ext.Ajax.request({
scope: this,
method: 'PUT',
@@ -46,6 +36,6 @@ Ext.define('Traccar.view.dialog.DeviceDistanceController', {
}
}
});
- button.up('window').close();
+ this.closeView();
}
});