changeset f8e41334bfe7 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=f8e41334bfe7
description:
Manage named separator as label
issue8961
review262741032
diffstat:
CHANGELOG | 1 +
src/view/form.js | 12 ++++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r c0ea6f596c1f -r f8e41334bfe7 CHANGELOG
--- a/CHANGELOG Fri Jan 24 00:18:19 2020 +0100
+++ b/CHANGELOG Fri Jan 24 00:25:30 2020 +0100
@@ -1,3 +1,4 @@
+* Manage named separator as label
* Add MultiSelection entry to Dict field
* Position new record based on order
* Reset display_size of TreeView when group is cleared or changed
diff -r c0ea6f596c1f -r f8e41334bfe7 src/view/form.js
--- a/src/view/form.js Fri Jan 24 00:18:19 2020 +0100
+++ b/src/view/form.js Fri Jan 24 00:25:30 2020 +0100
@@ -83,10 +83,10 @@
if (this._mnemonics[name] && widget.labelled) {
var label = this._mnemonics[name];
- label.el.uniqueId();
+ label.label_el.uniqueId();
widget.labelled.uniqueId();
widget.labelled.attr('aria-labelledby', label.el.attr('id'));
- label.el.attr('for', widget.labelled.attr('id'));
+ label.label_el.attr('for', widget.labelled.attr('id'));
}
},
_parse_button: function(node, attributes) {
@@ -101,10 +101,18 @@
this.container.add(image, attributes);
},
_parse_separator: function(node, attributes) {
+ var name = attributes.name;
+ if (name && (name == this.exclude_field)) {
+ this.container.add(null, attributes);
+ return;
+ }
var text = attributes.string;
var separator = new Sao.View.Form.Separator(text, attributes);
this.view.state_widgets.push(separator);
this.container.add(separator, attributes);
+ if (name) {
+ this._mnemonics[name] = separator;
+ }
},
_parse_label: function(node, attributes) {
var name = attributes.name;