From 488f01aea9e5d9f8ed7a1b680c8de5c139e4cc2a Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 8 Jun 2021 10:59:46 -0600 Subject: [PATCH] Etemplate: Only re-set label if the new value is different Fixes initialization could clear the link text if value was set first --- api/js/etemplate/et2_widget_url.js | 4 ++-- api/js/etemplate/et2_widget_url.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/et2_widget_url.js b/api/js/etemplate/et2_widget_url.js index 51e4ce7b96..bf5f56b7ce 100644 --- a/api/js/etemplate/et2_widget_url.js +++ b/api/js/etemplate/et2_widget_url.js @@ -303,8 +303,8 @@ export class et2_url_ro extends et2_valueWidget { * @param _value */ 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); } } diff --git a/api/js/etemplate/et2_widget_url.ts b/api/js/etemplate/et2_widget_url.ts index 65739225e2..224c18192c 100644 --- a/api/js/etemplate/et2_widget_url.ts +++ b/api/js/etemplate/et2_widget_url.ts @@ -362,9 +362,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); } }