Commit c48dae88 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Stringfield strips space characters

Mimic formulator behaviour to reduce jIO conflicts.
parent 4b946f64
......@@ -16,7 +16,8 @@
required: field_json.required,
name: field_json.key,
title: field_json.title,
hidden: field_json.hidden
hidden: field_json.hidden,
trim: true
};
state_dict.text_content = state_dict.value;
return this.changeState(state_dict);
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.22003.16805.3003</string> </value>
<value> <string>955.51162.4768.35123</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479375148.32</float>
<float>1481623167.42</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,7 +10,8 @@
checked: undefined,
title: '',
type: 'text',
required: false
required: false,
trim: false
})
.declareMethod('render', function (options) {
......@@ -24,7 +25,8 @@
title: options.title,
focus: options.focus,
step: options.step,
hidden: options.hidden
hidden: options.hidden,
trim: options.trim || false
};
return this.changeState(state_dict);
})
......@@ -104,10 +106,14 @@
if (input.checked) {
result[input.getAttribute('name')] = input.value;
}
} else {
if (this.state.trim) {
result[input.getAttribute('name')] = input.value.trim();
} else {
result[input.getAttribute('name')] = input.value;
}
}
}
return result;
})
......@@ -122,6 +128,9 @@
}
} else {
result = input.value;
if (this.state.trim) {
result = result.trim();
}
}
return result;
})
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.22004.39620.55808</string> </value>
<value> <string>955.51162.4768.35123</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1479376608.94</float>
<float>1481623333.62</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment