summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorAnton Kikin <a.kikin@tano-systems.com>2020-04-19 05:54:15 +0300
committerAnton Kikin <a.kikin@tano-systems.com>2020-04-19 13:56:24 +0300
commit7585e5c95adc69a6e86ae19dda5dfb60557cefdb (patch)
tree564b0936a366e9df5e00f450c2d87d0d009258a7 /modules/luci-base/htdocs/luci-static/resources
parentda0e974db5865daf6d634ae5f7649f5b5fc2ef31 (diff)
luci-base: form.js: allow to disable descriptions row in TableSection
Add 'nodescriptions' property to the TableSection class that allows to disable displaying table header row with descriptions. Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index 400ca036a..9e0a80ad3 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
});