Promote thumbnail carousel selected to a property.

This commit is contained in:
Dermot Duffy
2022-09-25 17:50:40 -07:00
parent 2f34d6e7fa
commit 56465e4f92
3 changed files with 23 additions and 19 deletions
+2 -1
View File
@@ -30,6 +30,7 @@ import { ThumbnailCarouselTap } from './thumbnail-carousel.js';
import './surround-basic.js';
import './timeline-core.js';
import { ifDefined } from 'lit/directives/if-defined.js';
interface ThumbnailViewContext {
// Whether or not to fetch thumbnails.
@@ -171,8 +172,8 @@ export class FrigateCardSurround extends LitElement {
.config=${this.thumbnailConfig}
.view=${this.view}
.target=${this.view.target}
.selected=${this.view.childIndex}
.cameras=${this.cameras}
selected=${ifDefined(this.view.childIndex ?? undefined)}
@frigate-card:view:change=${(ev: CustomEvent) => changeDrawer(ev, 'close')}
@frigate-card:thumbnail-carousel:tap=${(
ev: CustomEvent<ThumbnailCarouselTap>,