fix(core): update

This commit is contained in:
Philipp Kunz 2021-03-09 13:41:16 +00:00
parent 830eab2b18
commit cafe63348b

View File

@ -13,6 +13,9 @@ export class UptimelinkWebwidget extends DeesElement {
@property()
public isFocused = false;
@property()
public isElevated = false;
@property()
public showExpanded: boolean = false;
@ -30,7 +33,7 @@ export class UptimelinkWebwidget extends DeesElement {
position: relative;
display: block;
height: 30px;
z-index:10;
z-index: ${this.isElevated ? '10' : 'auto'} ;
}
.mainbox {
position: relative;
@ -154,6 +157,7 @@ export class UptimelinkWebwidget extends DeesElement {
await this.updateComplete;
const mainbox: HTMLDivElement = this.shadowRoot.querySelector('.mainbox');
mainbox.onmouseenter = async () => {
this.isElevated = true;
this.isFocused = true;
await domtools.DomTools.getGlobalDomToolsSync().convenience.smartdelay.delayFor(200);
if (!this.isFocused) {
@ -161,11 +165,16 @@ export class UptimelinkWebwidget extends DeesElement {
}
this.showExpanded = true;
await this.performUpdate();
await domtools.DomTools.getGlobalDomToolsSync().convenience.smartdelay.delayFor(50);
await (await this.domtoolsPromise).convenience.smartdelay.delayFor(50);
const expandedDiv = this.shadowRoot.querySelector('.expanded') as HTMLElement;
expandedDiv.style.opacity = '1';
};
mainbox.onmouseleave = async () => {
(await this.domtoolsPromise).convenience.smartdelay.delayFor(200).then(() => {
if (!this.isFocused) {
this.isElevated = false;
}
});
if (!this.showExpanded) {
this.isFocused = false;
return;