mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Don't show pointer for glance entity when there is no action (#17625)
This commit is contained in:
parent
eca3ec7f98
commit
92358b4859
@ -206,10 +206,12 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
width: var(--glance-column-width, 20%);
|
width: var(--glance-column-width, 20%);
|
||||||
}
|
}
|
||||||
|
.entity.action {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
.entity:focus {
|
.entity:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
background: var(--divider-color);
|
background: var(--divider-color);
|
||||||
@ -282,9 +284,15 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
const name = entityConf.name ?? computeStateName(stateObj);
|
const name = entityConf.name ?? computeStateName(stateObj);
|
||||||
|
|
||||||
|
const hasAnyAction =
|
||||||
|
!entityConf.tap_action ||
|
||||||
|
hasAction(entityConf.tap_action) ||
|
||||||
|
hasAction(entityConf.hold_action) ||
|
||||||
|
hasAction(entityConf.double_tap_action);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
class="entity"
|
class=${classMap({ entity: true, action: hasAnyAction })}
|
||||||
.config=${entityConf}
|
.config=${entityConf}
|
||||||
@action=${this._handleAction}
|
@action=${this._handleAction}
|
||||||
.actionHandler=${actionHandler({
|
.actionHandler=${actionHandler({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user