Merge pull request #3934 from tano-systems/pr/luci-base-form-js-nodesc

Allow to disable descriptions row in TableSection + descriptions render fix
This commit is contained in:
Jo-Philipp Wich 2020-04-19 17:34:24 +02:00 committed by GitHub
commit 4e8d309cf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2265,6 +2265,16 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
* @default false
*/
/**
* If set to `true`, the header row with the options descriptions will
* not be displayed. By default, descriptions row is automatically displayed
* when at least one option has a description.
*
* @name LuCI.form.TableSection.prototype#nodescriptions
* @type boolean
* @default false
*/
/**
* The `TableSection` implementation does not support option tabbing, so
* its implementation of `tab()` will always throw an exception when
@ -2402,7 +2412,7 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
trEls.appendChild(trEl);
}
if (has_descriptions) {
if (has_descriptions && !this.nodescriptions) {
var trEl = E('div', {
'class': 'tr cbi-section-table-descr ' + anon_class
});
@ -2421,7 +2431,7 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
(typeof(opt.width) == 'number') ? opt.width+'px' : opt.width;
}
if (this.sortable || this.extedit || this.addremove || has_more)
if (this.sortable || this.extedit || this.addremove || has_more || has_action)
trEl.appendChild(E('div', {
'class': 'th cbi-section-table-cell cbi-section-actions'
}));