From 3f86e98257b7ca4aad7056c9f9596cc622ee7a48 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 7 Apr 2022 16:24:45 -0600 Subject: [PATCH] Deal with et2-button-image showing label --- admin/templates/default/app.css | 5 ----- admin/templates/pixelegg/app.css | 8 +------ api/etemplate.php | 5 +++++ api/js/etemplate/Et2Button/Et2ButtonImage.ts | 23 ++++++++++++++++---- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/admin/templates/default/app.css b/admin/templates/default/app.css index a8da3531b7..6d42a62f56 100644 --- a/admin/templates/default/app.css +++ b/admin/templates/default/app.css @@ -150,11 +150,6 @@ span#admin-mailaccount_acc_id { width: 16px; vertical-align: top; } -#admin-mailaccount_button\[placeholders\] { - height: 16px; - padding-left: 5px; - vertical-align: middle; -} #admin-mailaccount_mailLocalAddress { width: 98%; } diff --git a/admin/templates/pixelegg/app.css b/admin/templates/pixelegg/app.css index 712bb9385d..3ea72981bd 100755 --- a/admin/templates/pixelegg/app.css +++ b/admin/templates/pixelegg/app.css @@ -156,11 +156,6 @@ span#admin-mailaccount_acc_id { width: 16px; vertical-align: top; } -#admin-mailaccount_button\[placeholders\] { - height: 16px; - padding-left: 5px; - vertical-align: middle; -} #admin-mailaccount_mailLocalAddress { width: 98%; } @@ -170,7 +165,6 @@ select#admin-mailaccount_ident_id { /** * new et2 site configuration */ -#admin-index_ajax_target > form[id$="-config"] tr.th > td, #admin-site-config > div > span.subHeader { border-bottom: 3px solid #696969; padding-left: 3px; @@ -214,7 +208,7 @@ Admin command @media all { div.dhtmlxTree td.standartTreeRow span.selectedTreeRow { background-color: rgba(102, 153, 204, 0.7); - color: #1e1e1e; + color: #1E1E1E; } /* ############################################################################# // iframe diff --git a/api/etemplate.php b/api/etemplate.php index 0137b6825e..6b4fc990fa 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -161,6 +161,11 @@ function send_template() if (!empty($attrs['image']) && (empty($attrs['background_image']) || $attrs['background_image'] === 'false')) { $tag = 'et2-button-image'; + if($attrs['label']) + { + $attrs['statustext'] = $attrs['label']; + unset($attrs['label']); + } } // novalidation --> noValidation if (!empty($attrs['novalidation']) && in_array($attrs['novalidation'], ['true', '1'], true)) diff --git a/api/js/etemplate/Et2Button/Et2ButtonImage.ts b/api/js/etemplate/Et2Button/Et2ButtonImage.ts index 253746c815..f81c5db292 100644 --- a/api/js/etemplate/Et2Button/Et2ButtonImage.ts +++ b/api/js/etemplate/Et2Button/Et2ButtonImage.ts @@ -22,12 +22,27 @@ export class Et2ButtonImage extends Et2Button /* Important needed to override boxes trying to stretch children */ flex: 0 0 !important; } - ::slotted[slot="label"] { - display: none; - } ` - ]; + + /** + * Handle changes that have to happen based on changes to properties + * + */ + requestUpdate(name : PropertyKey, oldValue) + { + super.requestUpdate(name, oldValue); + + // image only don't have labels, but we'll set hover instead + if(name == 'label') + { + if(!this.statustext) + { + this.statustext = this.label; + } + this.__label = ""; + } + } } // @ts-ignore TypeScript is not recognizing that Et2Button is a LitElement