luci-base: add new member 'hidden' to DummyValue
authorNicholas Smith <[email protected]>
Sat, 6 Feb 2021 01:12:36 +0000 (11:12 +1000)
committerNicholas Smith <[email protected]>
Tue, 9 Feb 2021 20:33:14 +0000 (06:33 +1000)
Signed-off-by: Nicholas Smith <[email protected]>
modules/luci-base/htdocs/luci-static/resources/form.js

index 58a31dddb2ebce6af8be0965aa2df04b2d687e0f..b318168f37659536106f6e727a0fe5ec8ca101f4 100644 (file)
@@ -3929,11 +3929,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 }));