Allow dragging/swiping to be disabled.

This commit is contained in:
Dermot Duffy
2021-11-06 15:24:51 -07:00
parent 9240264db0
commit 15266be2d7
5 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -197,7 +197,7 @@ export class FrigateCardViewerCore extends LitElement {
'.embla__viewport',
) as HTMLElement;
if (carouselNode) {
if (carouselNode && this.viewerConfig) {
this._loadedCarousel = true;
// Start the carousel on the selected child number.
@@ -209,6 +209,7 @@ export class FrigateCardViewerCore extends LitElement {
this._carousel = EmblaCarousel(carouselNode, {
startIndex: isNaN(startIndex) ? undefined : startIndex,
draggable: this.viewerConfig.draggable,
});
// Update views and dispatch media-show events based on slide selections.
this._carousel.on('select', this._selectSlideSetViewHandler.bind(this));