From 8294edc1d151346d0c7c4e624e4535fc23508f3d Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Mon, 5 May 2025 21:28:11 -0700 Subject: [PATCH] Annotation sequence in editor skips unused in set Signed-off-by: Justin Georgi --- modules/glmv-mvconfig.js | 5 +++-- modules/glmv.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/glmv-mvconfig.js b/modules/glmv-mvconfig.js index 9a1e1e6..56ae729 100644 --- a/modules/glmv-mvconfig.js +++ b/modules/glmv-mvconfig.js @@ -42,7 +42,7 @@ readMvconfig = function() { let mvconfig let slotNum = 1 - createHotspot = function(hsLabel, hsSlot, hsTag) { + createHotspot = function(hsLabel, hsSlot, hsTag, hsSkip) { let newHs = document.createElement('button') newHs.classList.add('Hotspot') newHs.setAttribute('slot',`hotspot-${hsSlot}`) @@ -50,6 +50,7 @@ readMvconfig = function() { newHs.setAttribute('onclick', 'onAnnotation(event)') newHs.setAttribute('onmousedown', 'grabAnnotation(event)') newHs.setAttribute('onmouseup', 'releaseAnnotation(event)') + newHs.toggleAttribute('seq-skip', !!hsSkip) Object.keys(mvconfig.annotations[hsLabel]).forEach((prop) => { newHs.setAttribute(prop, mvconfig.annotations[hsLabel][prop]) }) @@ -81,7 +82,7 @@ readMvconfig = function() { return } let label = (currentSet != 'default' && mvconfig.annotationSets[currentSet]) ? '-' : null - createHotspot(hs, slotNum, label) + createHotspot(hs, slotNum, label, true) slotNum += 1 }) diff --git a/modules/glmv.js b/modules/glmv.js index ec2f793..e5d089c 100644 --- a/modules/glmv.js +++ b/modules/glmv.js @@ -72,7 +72,7 @@ selectAnnotation = function(mView, annotId) { */ nextAnnotation = function(mView) { let incrAnnotation = 0 - const numSpots = [...mView.querySelectorAll('Button')].length + const numSpots = [...mView.querySelectorAll('Button:not([seq-skip])')].length const currentAnnotation = mView.querySelectorAll('Button:has(.HotspotAnnotation:not(.HiddenAnnotation))')[0] if (!currentAnnotation) { incrAnnotation = 1 @@ -95,7 +95,7 @@ nextAnnotation = function(mView) { */ prevAnnotation = function(mView) { let decrAnnotation = 0 - const numSpots = [...mView.querySelectorAll('Button')].length + const numSpots = [...mView.querySelectorAll('Button:not([seq-skip])')].length const currentAnnotation = mView.querySelectorAll('Button:has(.HotspotAnnotation:not(.HiddenAnnotation))')[0] if (!currentAnnotation) { decrAnnotation = numSpots