From 94ea366eb33694447812e6d63133aea28379d6f4 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 18 Jul 2016 11:12:14 +0500 Subject: - Added attributes to devices - Fixed license header for DeviceManager.java - Fixed editing attributes for not saved (new) object. --- web/app/view/AttributesController.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/app/view/AttributesController.js') diff --git a/web/app/view/AttributesController.js b/web/app/view/AttributesController.js index 8e6ab82a4..c042b765f 100644 --- a/web/app/view/AttributesController.js +++ b/web/app/view/AttributesController.js @@ -27,6 +27,9 @@ Ext.define('Traccar.view.AttributesController', { var store, propertyName, i = 0, attributes; store = Ext.create('Traccar.store.Attributes'); store.setProxy(Ext.create('Ext.data.proxy.Memory')); + if (this.getView().record.phantom) { + this.getView().record.set('attributes', {}); + } attributes = this.getView().record.get('attributes'); for (propertyName in attributes) { if (attributes.hasOwnProperty(propertyName)) { -- cgit v1.2.3 From bbfe8e8c328a660b8bdcdf089a8cd798cbbc5f2d Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 18 Jul 2016 11:34:54 +0500 Subject: Fix it in other way in case user open "attributes" again before save. --- web/app/view/AttributesController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/app/view/AttributesController.js') diff --git a/web/app/view/AttributesController.js b/web/app/view/AttributesController.js index c042b765f..5be94dec3 100644 --- a/web/app/view/AttributesController.js +++ b/web/app/view/AttributesController.js @@ -27,7 +27,7 @@ Ext.define('Traccar.view.AttributesController', { var store, propertyName, i = 0, attributes; store = Ext.create('Traccar.store.Attributes'); store.setProxy(Ext.create('Ext.data.proxy.Memory')); - if (this.getView().record.phantom) { + if (typeof this.getView().record.get('attributes') === 'undefined') { this.getView().record.set('attributes', {}); } attributes = this.getView().record.get('attributes'); -- cgit v1.2.3