Fix timeline recentering after manual scroll

This commit is contained in:
Dermot Duffy
2022-04-02 10:58:02 -07:00
parent a94f53f8da
commit 5b66c6cad6
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -91,6 +91,7 @@ export class FrigateCardThumbnail extends LitElement {
view: 'timeline', view: 'timeline',
target: this.target, target: this.target,
childIndex: this.childIndex, childIndex: this.childIndex,
context: {},
}) })
.dispatchChangeEvent(this); .dispatchChangeEvent(this);
}} }}
+3 -1
View File
@@ -604,11 +604,13 @@ export class FrigateCardTimelineCore extends LitElement {
? (this.view.context as TimelineViewContext) ? (this.view.context as TimelineViewContext)
: undefined; : undefined;
if (context && !isEqual(context.window, timelineWindow)) { if (context?.window) {
console.info( console.info(
`Setting window from context (${context.window.start} -> ${context.window.end}`, `Setting window from context (${context.window.start} -> ${context.window.end}`,
); );
if (!isEqual(context.window, timelineWindow)) {
this._timeline.setWindow(context.window.start, context.window.end); this._timeline.setWindow(context.window.start, context.window.end);
}
} else if ( } else if (
eventStart < timelineWindow.start || eventStart < timelineWindow.start ||
eventStart > timelineWindow.end || eventStart > timelineWindow.end ||