mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
fix double tap on glance entity (#4051)
This commit is contained in:
parent
880b382a16
commit
0005c75091
@ -183,7 +183,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
class="entity"
|
class="entity"
|
||||||
.entityConf="${entityConf}"
|
.config="${entityConf}"
|
||||||
@ha-click=${this._handleClick}
|
@ha-click=${this._handleClick}
|
||||||
@ha-hold=${this._handleHold}
|
@ha-hold=${this._handleHold}
|
||||||
@ha-dblclick=${this._handleDblClick}
|
@ha-dblclick=${this._handleDblClick}
|
||||||
@ -231,17 +231,17 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleClick(ev: MouseEvent): void {
|
private _handleClick(ev: MouseEvent): void {
|
||||||
const config = (ev.currentTarget as any).entityConf as GlanceConfigEntity;
|
const config = (ev.currentTarget as any).config as GlanceConfigEntity;
|
||||||
handleClick(this, this.hass!, config, false, false);
|
handleClick(this, this.hass!, config, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleHold(ev: MouseEvent): void {
|
private _handleHold(ev: MouseEvent): void {
|
||||||
const config = (ev.currentTarget as any).entityConf as GlanceConfigEntity;
|
const config = (ev.currentTarget as any).config as GlanceConfigEntity;
|
||||||
handleClick(this, this.hass!, config, true, false);
|
handleClick(this, this.hass!, config, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleDblClick(ev: MouseEvent): void {
|
private _handleDblClick(ev: MouseEvent): void {
|
||||||
const config = (ev.currentTarget as any).entityConf as GlanceConfigEntity;
|
const config = (ev.currentTarget as any).config as GlanceConfigEntity;
|
||||||
handleClick(this, this.hass!, config, false, true);
|
handleClick(this, this.hass!, config, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _handleDblClick(ev: MouseEvent): void {
|
private _handleDblClick(ev: MouseEvent): void {
|
||||||
const config = (ev.currentTarget as any).entityConf as any;
|
const config = (ev.currentTarget as any).config as any;
|
||||||
handleClick(this, this.hass!, config, false, true);
|
handleClick(this, this.hass!, config, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user