From 259bc4cd71e617e918330f051e3e1385688a8dfe Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 9 Aug 2022 16:46:45 +0200 Subject: [PATCH] fix not working click on URL static method Et2Url.action() can NOT use this.egw(), but global egw --- api/js/etemplate/Et2Url/Et2Url.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Url/Et2Url.ts b/api/js/etemplate/Et2Url/Et2Url.ts index 04762ee752..7f3f98d82b 100644 --- a/api/js/etemplate/Et2Url/Et2Url.ts +++ b/api/js/etemplate/Et2Url/Et2Url.ts @@ -12,6 +12,7 @@ import {Et2InvokerMixin} from "./Et2InvokerMixin"; import {Et2Textbox} from "../Et2Textbox/Et2Textbox"; import {colorsDefStyles} from "../Styles/colorsDefStyles"; import {css} from "@lion/core"; +import {egw} from "../../jsapi/egw_global"; /** * @customElement et2-url @@ -99,7 +100,8 @@ export class Et2Url extends Et2InvokerMixin(Et2Textbox) if (!value) return; // implicit add http:// if no protocol given if(value.indexOf("://") === -1) value = "http://"+value; - this.egw().open_link(value, '_blank'); + // as this is static, we can NOT use this.egw(), but global egw + egw.open_link(value, '_blank'); } } // @ts-ignore TypeScript is not recognizing that this is a LitElement