Only show gallery back button in certain cases.
This commit is contained in:
@@ -239,7 +239,6 @@ export class BrowseMediaUtil {
|
||||
view
|
||||
.evolve({
|
||||
target: parent,
|
||||
previous: view,
|
||||
})
|
||||
.dispatchChangeEvent(node);
|
||||
}
|
||||
|
||||
@@ -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,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).
|
||||
|
||||
Reference in New Issue
Block a user