aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-11 10:43:26 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-11 10:43:26 +0500
commitc9a4996cefa55ed8fb4571f440bd81e74fc91167 (patch)
treec34d221c8567b8f180e5c516a8e5385eea8965a9 /web
parent894fc83e1c775e10bd24b42b6b85779fa5fc7cb7 (diff)
downloadtrackermap-server-c9a4996cefa55ed8fb4571f440bd81e74fc91167.tar.gz
trackermap-server-c9a4996cefa55ed8fb4571f440bd81e74fc91167.tar.bz2
trackermap-server-c9a4996cefa55ed8fb4571f440bd81e74fc91167.zip
- "from" sometimes not handled by mail servers
- better handle empty mail user attributes - fix deleting attribute in attribute editor - fix duplicating attribute if name changed
Diffstat (limited to 'web')
-rw-r--r--web/app/view/AttributesController.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/app/view/AttributesController.js b/web/app/view/AttributesController.js
index 663b6eae3..3959c5a5c 100644
--- a/web/app/view/AttributesController.js
+++ b/web/app/view/AttributesController.js
@@ -37,17 +37,22 @@ Ext.define('Traccar.view.AttributesController', {
store.addListener('add', function (store , records , index , eOpts) {
for (var i = 0; i < records.length; i++) {
this.getView().record.get('attributes')[records[i].get('name')] = records[i].get('value');
- this.getView().record.dirty = true;
}
+ this.getView().record.dirty = true;
}, this);
store.addListener('update', function (store, record, operation , modifiedFieldNames , details , eOpts) {
if (operation === Ext.data.Model.EDIT) {
+ if (record.modified.name !== record.get('name')) {
+ delete this.getView().record.get('attributes')[record.modified.name];
+ }
this.getView().record.get('attributes')[record.get('name')] = record.get('value');
this.getView().record.dirty = true;
}
}, this);
store.addListener('remove', function (store , records , index , isMove , eOpts) {
- delete this.getView().record.get('attributes')[records[index].get('name')];
+ for (var i = 0; i < records.length; i++) {
+ delete this.getView().record.get('attributes')[records[i].get('name')];
+ }
this.getView().record.dirty = true;
}, this);