Annotation sequence in editor skips unused in set
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -42,7 +42,7 @@ readMvconfig = function() {
|
|||||||
let mvconfig
|
let mvconfig
|
||||||
let slotNum = 1
|
let slotNum = 1
|
||||||
|
|
||||||
createHotspot = function(hsLabel, hsSlot, hsTag) {
|
createHotspot = function(hsLabel, hsSlot, hsTag, hsSkip) {
|
||||||
let newHs = document.createElement('button')
|
let newHs = document.createElement('button')
|
||||||
newHs.classList.add('Hotspot')
|
newHs.classList.add('Hotspot')
|
||||||
newHs.setAttribute('slot',`hotspot-${hsSlot}`)
|
newHs.setAttribute('slot',`hotspot-${hsSlot}`)
|
||||||
@@ -50,6 +50,7 @@ readMvconfig = function() {
|
|||||||
newHs.setAttribute('onclick', 'onAnnotation(event)')
|
newHs.setAttribute('onclick', 'onAnnotation(event)')
|
||||||
newHs.setAttribute('onmousedown', 'grabAnnotation(event)')
|
newHs.setAttribute('onmousedown', 'grabAnnotation(event)')
|
||||||
newHs.setAttribute('onmouseup', 'releaseAnnotation(event)')
|
newHs.setAttribute('onmouseup', 'releaseAnnotation(event)')
|
||||||
|
newHs.toggleAttribute('seq-skip', !!hsSkip)
|
||||||
Object.keys(mvconfig.annotations[hsLabel]).forEach((prop) => {
|
Object.keys(mvconfig.annotations[hsLabel]).forEach((prop) => {
|
||||||
newHs.setAttribute(prop, mvconfig.annotations[hsLabel][prop])
|
newHs.setAttribute(prop, mvconfig.annotations[hsLabel][prop])
|
||||||
})
|
})
|
||||||
@@ -81,7 +82,7 @@ readMvconfig = function() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let label = (currentSet != 'default' && mvconfig.annotationSets[currentSet]) ? '-' : null
|
let label = (currentSet != 'default' && mvconfig.annotationSets[currentSet]) ? '-' : null
|
||||||
createHotspot(hs, slotNum, label)
|
createHotspot(hs, slotNum, label, true)
|
||||||
slotNum += 1
|
slotNum += 1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ selectAnnotation = function(mView, annotId) {
|
|||||||
*/
|
*/
|
||||||
nextAnnotation = function(mView) {
|
nextAnnotation = function(mView) {
|
||||||
let incrAnnotation = 0
|
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]
|
const currentAnnotation = mView.querySelectorAll('Button:has(.HotspotAnnotation:not(.HiddenAnnotation))')[0]
|
||||||
if (!currentAnnotation) {
|
if (!currentAnnotation) {
|
||||||
incrAnnotation = 1
|
incrAnnotation = 1
|
||||||
@@ -95,7 +95,7 @@ nextAnnotation = function(mView) {
|
|||||||
*/
|
*/
|
||||||
prevAnnotation = function(mView) {
|
prevAnnotation = function(mView) {
|
||||||
let decrAnnotation = 0
|
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]
|
const currentAnnotation = mView.querySelectorAll('Button:has(.HotspotAnnotation:not(.HiddenAnnotation))')[0]
|
||||||
if (!currentAnnotation) {
|
if (!currentAnnotation) {
|
||||||
decrAnnotation = numSpots
|
decrAnnotation = numSpots
|
||||||
|
|||||||
Reference in New Issue
Block a user