Skip to content

Commit

Permalink
close button
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocjohn committed Jun 5, 2024
1 parent 89c7b8e commit 26abb58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/vehicle-info-card.js

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

7 changes: 5 additions & 2 deletions src/vehicle-info-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
LovelaceCard,
LovelaceCardConfig,
fireEvent,
computeCardSize,
} from 'custom-card-helpers'; // This is a community maintained npm module with common helper functions/types. https://github.com/custom-cards/custom-card-helpers

import {
Expand Down Expand Up @@ -414,7 +413,7 @@ export class VehicleCard extends LitElement {
private _renderAdditionalCardHeader(): TemplateResult {
return html`
<div class="added-card-header">
<div class="headder-btn" @click="${() => this.activeCardType && this.toggleCard(this.activeCardType)}">
<div class="headder-btn" @click="${() => this.closeAddedCard()}">
<ha-icon icon="mdi:close"></ha-icon>
</div>
<div class="card-toggle ">
Expand All @@ -429,6 +428,10 @@ export class VehicleCard extends LitElement {
`;
}

private closeAddedCard(): void {
this.activeCardType = null;
}

private toggleNextCard(): void {
if (!this.activeCardType) return;

Expand Down

0 comments on commit 26abb58

Please sign in to comment.