Etemplate: Only re-set label if the new value is different

Fixes initialization could clear the link text if value was set first
This commit is contained in:
nathangray 2021-06-08 10:59:46 -06:00 committed by Ralf Becker
parent bfea641321
commit 488f01aea9
2 changed files with 4 additions and 4 deletions

View File

@ -303,8 +303,8 @@ export class et2_url_ro extends et2_valueWidget {
* @param _value * @param _value
*/ */
set_label(_value) { set_label(_value) {
if (this.span && this.options.label !== _value) {
this.options.label = _value; this.options.label = _value;
if (this.span) {
this.span.text(_value); this.span.text(_value);
} }
} }

View File

@ -362,9 +362,9 @@ export class et2_url_ro extends et2_valueWidget
*/ */
set_label(_value) set_label(_value)
{ {
this.options.label = _value; if(this.span && this.options.label !== _value)
if(this.span)
{ {
this.options.label = _value;
this.span.text(_value); this.span.text(_value);
} }
} }