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
parent c9c9f28851
commit 2c5461b953
2 changed files with 4 additions and 4 deletions

View File

@ -324,8 +324,8 @@ var et2_url_ro = /** @class */ (function (_super_1) {
* @param _value
*/
et2_url_ro.prototype.set_label = function (_value) {
this.options.label = _value;
if (this.span) {
if (this.span && this.options.label !== _value) {
this.options.label = _value;
this.span.text(_value);
}
};

View File

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