luci-base: form.js: trim option description
If a whitespace-only description is set on an element, the CSS :empty selector will not match, causing description icons to be shown when there's no actual content. To avoid that, trim the description string when building the element. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
4e090e38d2
commit
b6ae1d4f4a
1 changed files with 1 additions and 1 deletions
|
@ -3754,7 +3754,7 @@ var CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */ {
|
||||||
|
|
||||||
if (!in_table && typeof(this.description) === 'string' && this.description !== '')
|
if (!in_table && typeof(this.description) === 'string' && this.description !== '')
|
||||||
dom.append(optionEl.lastChild || optionEl,
|
dom.append(optionEl.lastChild || optionEl,
|
||||||
E('div', { 'class': 'cbi-value-description' }, this.description));
|
E('div', { 'class': 'cbi-value-description' }, this.description.trim()));
|
||||||
|
|
||||||
if (depend_list && depend_list.length)
|
if (depend_list && depend_list.length)
|
||||||
optionEl.classList.add('hidden');
|
optionEl.classList.add('hidden');
|
||||||
|
|
Loading…
Reference in a new issue