luci-base: add new member 'hidden' to DummyValue
Signed-off-by: Nicholas Smith <nicholas@nbembedded.com>
This commit is contained in:
parent
5da8a0d23f
commit
936dde7422
1 changed files with 11 additions and 1 deletions
|
@ -3929,11 +3929,21 @@ var CBIDummyValue = CBIValue.extend(/** @lends LuCI.form.DummyValue.prototype */
|
||||||
* @default null
|
* @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 */
|
/** @private */
|
||||||
renderWidget: function(section_id, option_index, cfgvalue) {
|
renderWidget: function(section_id, option_index, cfgvalue) {
|
||||||
var value = (cfgvalue != null) ? cfgvalue : this.default,
|
var value = (cfgvalue != null) ? cfgvalue : this.default,
|
||||||
hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) }),
|
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))
|
if (this.href && !((this.readonly != null) ? this.readonly : this.map.readonly))
|
||||||
outputEl.appendChild(E('a', { 'href': this.href }));
|
outputEl.appendChild(E('a', { 'href': this.href }));
|
||||||
|
|
Loading…
Reference in a new issue