mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
Resolve some Et2ButtonIcon issues from Shoelace upgrade
- Avoid some 404s with egroupware icons trying to load from shoelace - Fix Shoelace icon not shown when button has an ID
This commit is contained in:
parent
0846fa78f3
commit
7ed9eef29d
@ -43,11 +43,22 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton))
|
||||
{
|
||||
this.src = this.egw().image(new_image);
|
||||
}
|
||||
if(new_image && !this.src)
|
||||
|
||||
// For some reason setting it directly does not show the image
|
||||
this.updateComplete.then(() =>
|
||||
{
|
||||
// For some reason setting it directly does not show the image
|
||||
this.updateComplete.then(() => this.name = new_image);
|
||||
}
|
||||
const icon = this.shadowRoot.querySelector('sl-icon');
|
||||
icon.id = "";
|
||||
if(new_image && !this.src)
|
||||
{
|
||||
icon.src = "";
|
||||
icon.name = new_image;
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.name = "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get image()
|
||||
|
@ -15,7 +15,7 @@ import {egw} from "../../jsapi/egw_global";
|
||||
registerIconLibrary('default', {
|
||||
resolver: name =>
|
||||
{
|
||||
return typeof egw !== "undefined" ? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg` : ''
|
||||
return typeof egw !== "undefined" ? (egw.image(name) ?? `${egw.webserverUrl || ""}/node_modules/@shoelace-style/shoelace/dist/assets/icons/${name}.svg`) : ''
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user