From a01b10238d96707ea0cb193980cafccc49492cd8 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 31 Oct 2024 14:20:56 +0100 Subject: [PATCH] switch between button and link state --- ...ity-create-option-action-list-modal.element.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/modal/entity-create-option-action-list-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/modal/entity-create-option-action-list-modal.element.ts index 1db65a8f85..270bd46805 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/modal/entity-create-option-action-list-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/modal/entity-create-option-action-list-modal.element.ts @@ -59,6 +59,14 @@ export class UmbEntityCreateOptionActionListModalElement extends UmbModalBaseEle await controller.api.execute(); } + #getTarget(href?: string) { + if (href && href.startsWith('http')) { + return '_blank'; + } + + return '_self'; + } + override render() { return html` @@ -87,12 +95,15 @@ export class UmbEntityCreateOptionActionListModalElement extends UmbModalBaseEle const href = this._hrefList[index]; return html` - this.#onClick(event, controller)} - href=${ifDefined(href)}> + href=${ifDefined(href)} + target=${this.#getTarget(href)} + ?selectable=${!href} + ?readonly=${!href}> `; } }