Deal with et2-button-image showing label

This commit is contained in:
nathan 2022-04-07 16:24:45 -06:00
parent fe91205192
commit 3f86e98257
4 changed files with 25 additions and 16 deletions

View File

@ -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%;
}

View File

@ -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

View File

@ -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))

View File

@ -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