luci-base: form.js: do not add title attributes for untitled options
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
5223c7c221
commit
158515d5bd
1 changed files with 5 additions and 2 deletions
|
@ -1075,6 +1075,8 @@ var CBITableSection = CBITypedSection.extend({
|
||||||
renderHeaderRows: function(max_cols) {
|
renderHeaderRows: function(max_cols) {
|
||||||
var has_titles = false,
|
var has_titles = false,
|
||||||
has_descriptions = false,
|
has_descriptions = false,
|
||||||
|
max_cols = isNaN(this.max_cols) ? this.children.length : this.max_cols,
|
||||||
|
has_more = max_cols < this.children.length,
|
||||||
anon_class = (!this.anonymous || this.sectiontitle) ? 'named' : 'anonymous',
|
anon_class = (!this.anonymous || this.sectiontitle) ? 'named' : 'anonymous',
|
||||||
trEls = E([]);
|
trEls = E([]);
|
||||||
|
|
||||||
|
@ -1439,7 +1441,7 @@ var CBIGridSection = CBITableSection.extend({
|
||||||
|
|
||||||
return E('div', {
|
return E('div', {
|
||||||
'class': 'td cbi-value-field',
|
'class': 'td cbi-value-field',
|
||||||
'data-title': (title != '') ? title : opt.option,
|
'data-title': (title != '') ? title : null,
|
||||||
'data-description': (descr != '') ? descr : null,
|
'data-description': (descr != '') ? descr : null,
|
||||||
'data-name': opt.option,
|
'data-name': opt.option,
|
||||||
'data-type': opt.typename || opt.__name__
|
'data-type': opt.typename || opt.__name__
|
||||||
|
@ -1578,9 +1580,10 @@ var CBIValue = CBIAbstractValue.extend({
|
||||||
optionEl;
|
optionEl;
|
||||||
|
|
||||||
if (in_table) {
|
if (in_table) {
|
||||||
|
var title = this.stripTags(this.title).trim();
|
||||||
optionEl = E('div', {
|
optionEl = E('div', {
|
||||||
'class': 'td cbi-value-field',
|
'class': 'td cbi-value-field',
|
||||||
'data-title': this.stripTags(this.title).trim(),
|
'data-title': (title != '') ? title : null,
|
||||||
'data-description': this.stripTags(this.description).trim(),
|
'data-description': this.stripTags(this.description).trim(),
|
||||||
'data-name': this.option,
|
'data-name': this.option,
|
||||||
'data-type': this.typename || (this.template ? this.template.replace(/^.+\//, '') : null) || this.__name__
|
'data-type': this.typename || (this.template ? this.template.replace(/^.+\//, '') : null) || this.__name__
|
||||||
|
|
Loading…
Reference in a new issue