From 6eda9152936267cd76d64e2564c6a46b00213913 Mon Sep 17 00:00:00 2001 From: James Hobin Date: Thu, 4 Apr 2024 14:41:01 -0400 Subject: [PATCH] Make Mark Step button immediately start next step; Start in Step 1 --- tools/spatialAnalytics/index.css | 7 ------- tools/spatialAnalytics/index.js | 22 ++++++++-------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/tools/spatialAnalytics/index.css b/tools/spatialAnalytics/index.css index 4439905..a7e6d58 100644 --- a/tools/spatialAnalytics/index.css +++ b/tools/spatialAnalytics/index.css @@ -92,13 +92,6 @@ img { margin-top: calc(50% - 19px); } -.iconBackground.start { - border-color: green; -} -.iconBackground.end { - border-color: red; -} - .markStepIcon.pressed { filter: brightness(0.5); } diff --git a/tools/spatialAnalytics/index.js b/tools/spatialAnalytics/index.js index ec606b7..4c4fd6d 100644 --- a/tools/spatialAnalytics/index.js +++ b/tools/spatialAnalytics/index.js @@ -82,6 +82,7 @@ recordingIcon.addEventListener('pointerup', function() { case RecordingState.empty: setRecordingState(RecordingState.recording); startTime = Date.now(); + regionCardStartTime = startTime; spatialInterface.analyticsSetDisplayRegion({ recordingState, startTime, @@ -157,20 +158,13 @@ markStepIcon.addEventListener('pointerup', function() { if (recordingState !== RecordingState.recording) { return; } - if (regionCardStartTime > 0) { - let regionCardEndTime = Date.now(); - appendRegionCard({ - startTime: regionCardStartTime, - endTime: regionCardEndTime, - }); - regionCardStartTime = -1; - markStepIcon.parentNode.classList.remove('end'); - markStepIcon.parentNode.classList.add('start'); - } else { - regionCardStartTime = Date.now(); - markStepIcon.parentNode.classList.remove('start'); - markStepIcon.parentNode.classList.add('end'); - } + let regionCardEndTime = Date.now(); + appendRegionCard({ + startTime: regionCardStartTime, + endTime: regionCardEndTime, + }); + // Immediately start next regionCard + regionCardStartTime = regionCardEndTime; }); let lastSetDisplayRegion = {};