aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-04-05 09:38:40 +0500
committerAbyss777 <abyss@fox5.ru>2017-04-05 09:58:39 +0500
commitfbe7831f7765d62853641750b85861b19a2a8715 (patch)
tree9373f6d0526e14784501316b6b3ad6959b9ec6e6 /web
parent94fc6862c6635c680afc600a19f61fb9aaefe0ef (diff)
downloadtrackermap-web-fbe7831f7765d62853641750b85861b19a2a8715.tar.gz
trackermap-web-fbe7831f7765d62853641750b85861b19a2a8715.tar.bz2
trackermap-web-fbe7831f7765d62853641750b85861b19a2a8715.zip
Handle allowDecimals config
Diffstat (limited to 'web')
-rw-r--r--web/app/store/ServerAttributes.js3
-rw-r--r--web/app/store/UserAttributes.js4
-rw-r--r--web/app/view/dialog/AttributeController.js17
3 files changed, 13 insertions, 11 deletions
diff --git a/web/app/store/ServerAttributes.js b/web/app/store/ServerAttributes.js
index 23755ba9..aca81f22 100644
--- a/web/app/store/ServerAttributes.js
+++ b/web/app/store/ServerAttributes.js
@@ -31,6 +31,7 @@ Ext.define('Traccar.store.ServerAttributes', {
type: 'number'
}, {
key: 'web.liveRouteLength',
- type: 'number'
+ type: 'number',
+ allowDecimals: false
}]
});
diff --git a/web/app/store/UserAttributes.js b/web/app/store/UserAttributes.js
index 37204751..80ded0d8 100644
--- a/web/app/store/UserAttributes.js
+++ b/web/app/store/UserAttributes.js
@@ -26,6 +26,7 @@ Ext.define('Traccar.store.UserAttributes', {
}, {
key: 'mail.smtp.port',
type: 'number',
+ allowDecimals: false,
minValue: 1,
maxValue: 65535
}, {
@@ -57,6 +58,7 @@ Ext.define('Traccar.store.UserAttributes', {
type: 'string'
}, {
key: 'web.liveRouteLength',
- type: 'number'
+ type: 'number',
+ allowDecimals: false
}]
});
diff --git a/web/app/view/dialog/AttributeController.js b/web/app/view/dialog/AttributeController.js
index 7ddab11c..ca1436fd 100644
--- a/web/app/view/dialog/AttributeController.js
+++ b/web/app/view/dialog/AttributeController.js
@@ -54,19 +54,19 @@ Ext.define('Traccar.view.dialog.AttributeController', {
onNameChange: function (combobox, newValue) {
var type, config, valueField = this.lookupReference('valueField'),
- attribute = combobox.getStore().getById(newValue);
+ attribute = combobox.getStore().getById(newValue);
if (attribute) {
type = attribute.get('type');
config = Ext.clone(this.defaultFieldConfig);
if (type === 'number') {
config.xtype = 'numberfield';
- config.allowDecimals = false;
- if (attribute.get('maxValue')) {
- config.maxValue = attribute.get('maxValue');
- }
- if (attribute.get('minValue')) {
- config.minValue = attribute.get('minValue');
+ if (attribute.get('allowDecimals') !== undefined) {
+ config.allowDecimals = attribute.get('allowDecimals');
+ } else {
+ config.allowDecimals = true;
}
+ config.maxValue = attribute.get('maxValue');
+ config.minValue = attribute.get('minValue');
} else if (type === 'boolean') {
config.xtype = 'checkboxfield';
config.inputValue = true;
@@ -80,8 +80,7 @@ Ext.define('Traccar.view.dialog.AttributeController', {
this.getView().down('form').insert(this.getView().down('form').items.indexOf(valueField), config);
this.getView().down('form').remove(valueField);
} else if (config.xtype === 'numberfield') {
- valueField.setMinValue(config.minValue);
- valueField.setMaxValue(config.maxValue);
+ valueField.setConfig(config);
}
}
}