From 8c5a3d37bdae7fe6bded2739effafc3687729b6b Mon Sep 17 00:00:00 2001 From: Anton Kikin Date: Sun, 19 Apr 2020 05:54:15 +0300 Subject: [PATCH] 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 (cherry picked from commit 7585e5c95adc69a6e86ae19dda5dfb60557cefdb) --- .../luci-base/htdocs/luci-static/resources/form.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 2f0fe714a..268cd378a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -2245,6 +2245,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 @@ -2382,7 +2392,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 }); -- 2.25.1