Annotation sequence in editor skips unused in set

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2025-05-05 21:28:11 -07:00
parent 846106a1a8
commit 8294edc1d1
2 changed files with 5 additions and 4 deletions

View File

@@ -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
})

View File

@@ -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