From d23b7c1a5167665a0d7467d74c6571e23ce3459a Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 11 May 2022 15:10:09 -0600 Subject: [PATCH] Link fixes - Enable link webcomponents in etemplate.php - Fix widget ID got overwritten - Put title into light DOM for easier styling - Styling --- api/etemplate.php | 2 +- api/js/etemplate/Et2Link/Et2Link.ts | 15 ++++++++++++--- api/templates/default/etemplate2.css | 12 ++++++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/api/etemplate.php b/api/etemplate.php index 224d71930e..1a14abd4dc 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -13,7 +13,7 @@ use EGroupware\Api; // add et2- prefix to following widgets/tags, if NO (Et2Widget(LitElement)) imple display: block; cursor: pointer; } + :host:hover { + text-decoration: underline + } /** Style based on parent **/ :host-context(et2-link-string) { display: inline; } - :host-context(et2-link-string):hover { - text-decoration: underline; + :host-context(et2-link-list):hover { + text-decoration: none; } ` ]; @@ -125,6 +128,11 @@ export class Et2Link extends ExposeMixin(Et2Widget(LitElement)) imple super.connectedCallback(); } + createRenderRoot() + { + return this; + } + render() { let title = this.title; @@ -155,7 +163,7 @@ export class Et2Link extends ExposeMixin(Et2Widget(LitElement)) imple if(!_value) { this.app = ""; - this.id = ""; + this.entry_id = ""; this.title = ""; return; } @@ -191,6 +199,7 @@ export class Et2Link extends ExposeMixin(Et2Widget(LitElement)) imple } Object.keys(_value).forEach(key => { + // Skip these, they're either handled explicitly, or ID which we don't want to mess with if(["app", "entry_id", "title", "id"].indexOf(key) != -1) { return; diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 40617dfd48..241242cd95 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -1235,13 +1235,13 @@ div.et2_link_entry input.ui-autocomplete-input { padding-right: 0; } -.et2_link, et2-link-string > et2-link { +.et2_link, et2-link { cursor: pointer; color: #003075; text-decoration: none; } -.et2_link:hover { +.et2_link:hover, et2-link:hover { text-decoration: underline; } @@ -1288,6 +1288,14 @@ ul.et2_link_string { height: 16px; } +et2-link-list et2-link { + color: initial; +} + +et2-link-list et2-link:hover { + text-decoration: initial; +} + .et2_link_list .icon img, .et2_vfs .icon img { width: 16px;