Skip to content

Commit

Permalink
cleanup click handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich committed Oct 21, 2019
1 parent 621f467 commit 0622f49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
9 changes: 4 additions & 5 deletions dist/restriction-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/restriction-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ class RestrictionCard extends LitElement implements LovelaceCard {
? ""
: html`
<div
@ha-click=${this._handleClick}
@ha-hold=${this._handleHold}
@ha-dblclick=${this._handleDblClick}
.longPress=${longPress({
hasDoubleClick: this._config!.action === "double_tap",
})}
@click=${this._handleClick}
@ha-click=${this._handleClick}
@ha-hold=${this._handleHold}
@ha-dblclick=${this._handleDblClick}
.longPress=${longPress({
hasDoubleClick: this._config!.action === "double_tap"
})}
id="overlay"
class="${classMap({
blocked: this._config.restrictions
Expand Down Expand Up @@ -171,7 +170,7 @@ class RestrictionCard extends LitElement implements LovelaceCard {
}
}

private _handleHold() : void {
private _handleHold(): void {
if (this._config!.action === "hold") {
this._handleRestriction();
}
Expand Down

0 comments on commit 0622f49

Please sign in to comment.