forked from Github/frigate
Better segment clicking (#10321)
* better segment clicking on motion segments * move handlebar on click when handlebar is showing * only scroll handlebar if needed
This commit is contained in:
@@ -124,7 +124,7 @@ function UIPlayground() {
|
||||
const [mockEvents, setMockEvents] = useState<ReviewSegment[]>([]);
|
||||
const [mockMotionData, setMockMotionData] = useState<MotionData[]>([]);
|
||||
const [handlebarTime, setHandlebarTime] = useState(
|
||||
Math.floor(Date.now() / 1000) - 15 * 60,
|
||||
Math.round((Date.now() / 1000 - 15 * 60) / 60) * 60,
|
||||
);
|
||||
|
||||
useMemo(() => {
|
||||
@@ -285,7 +285,7 @@ function UIPlayground() {
|
||||
<MotionReviewTimeline
|
||||
segmentDuration={zoomSettings.segmentDuration} // seconds per segment
|
||||
timestampSpread={zoomSettings.timestampSpread} // minutes between each major timestamp
|
||||
timelineStart={Math.floor(Date.now() / 1000)} // timestamp start of the timeline - the earlier time
|
||||
timelineStart={Math.round(((Date.now() / 1000) * 60) / 60) * 60} // timestamp start of the timeline - the earlier time
|
||||
timelineEnd={Math.floor(Date.now() / 1000) - 6 * 60 * 60} // end of timeline - the later time
|
||||
showHandlebar // show / hide the handlebar
|
||||
handlebarTime={handlebarTime} // set the time of the handlebar
|
||||
|
||||
Reference in New Issue
Block a user