diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-04-19 17:34:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 17:34:24 +0200 |
commit | 4e8d309cf16a4e8f823a7bf1fe34532267d0f54c (patch) | |
tree | 167ae37f10460f55a98dd872ea8063c43970dd17 | |
parent | ffd627f2a1aec456a9f8320a4bc5be6c9d54d7f4 (diff) | |
parent | 7585e5c95adc69a6e86ae19dda5dfb60557cefdb (diff) |
Merge pull request #3934 from tano-systems/pr/luci-base-form-js-nodesc
Allow to disable descriptions row in TableSection + descriptions render fix
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/form.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index c65cb04b13..9e0a80ad33 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -2266,6 +2266,16 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p */ /** + * 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 * invoked. @@ -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' })); |