Only show gallery back button in certain cases.

This commit is contained in:
Dermot Duffy
2022-04-09 09:59:11 -07:00
parent 616c24c94b
commit 90b06ef22f
3 changed files with 13 additions and 3 deletions
+13 -1
View File
@@ -129,6 +129,18 @@ export class FrigateCardGalleryCore extends LitElement {
);
}
/**
* Determine whether the back arrow should be displayed.
* @returns `true` if the back arrow should be displayed, `false` otherwise.
*/
protected _showBackArrow(): boolean {
return (
!!this.view?.previous &&
!!this.view.previous.target &&
this.view.previous.view === this.view.view
);
}
/**
* Master render method.
* @returns A rendered template.
@@ -158,7 +170,7 @@ export class FrigateCardGalleryCore extends LitElement {
};
return html` <ul class="mdc-image-list frigate-card-gallery">
${this.view && this.view.previous
${this._showBackArrow()
? html`<li class="mdc-image-list__item" style="${styleMap(itemStyle)}">
<div class="mdc-image-list__image-aspect-container">
<div class="mdc-image-list__image">
-1
View File
@@ -1,4 +1,3 @@
// TODO: Hover over an event should show something useful.
// TODO: Periodically refetch events.
// TODO: Editor support for timeline (incl. in views).
// TODO: Make thumbnail controls optional (in all places that use thumbnails).