summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-02 08:23:45 +0200
committerGitHub <noreply@github.com>2021-06-02 08:23:45 +0200
commit1255c4832e010909a22ad0ac6488eba8a265c1c8 (patch)
treef2575da39dcb2b78e393a266041782f56d3535a4 /modules
parent064e5cca96eb2f0f9a34654eb62106ec54f4b220 (diff)
parent936dde742256c6f81c335e5847524e2771913775 (diff)
Merge pull request #4770 from nickberry17/update_DummyValue
luci-base: add new member 'hidden' to DummyValue
Diffstat (limited to 'modules')
-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 8fc8d3aca7..52506d30e8 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -3954,11 +3954,21 @@ var CBIDummyValue = CBIValue.extend(/** @lends LuCI.form.DummyValue.prototype */
* @default null
*/
+ /**
+ * Render the UCI option value as hidden using the HTML display: none style property.
+ *
+ * By default, the value is displayed
+ *
+ * @name LuCI.form.DummyValue.prototype#hidden
+ * @type boolean
+ * @default null
+ */
+
/** @private */
renderWidget: function(section_id, option_index, cfgvalue) {
var value = (cfgvalue != null) ? cfgvalue : this.default,
hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) }),
- outputEl = E('div');
+ outputEl = E('div', { 'style': this.hidden ? 'display:none' : null });
if (this.href && !((this.readonly != null) ? this.readonly : this.map.readonly))
outputEl.appendChild(E('a', { 'href': this.href }));