Disable hotspot buttons on hotspot hide

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-29 17:50:51 -07:00
parent 4f1ff35194
commit 11bac465d9
3 changed files with 18 additions and 4 deletions

View File

@@ -126,6 +126,11 @@
&[toggled] {
background: #00000033;
}
&[disabled] {
pointer-events: none;
opacity: .3;
}
}
.prev-hs img {

View File

@@ -151,7 +151,7 @@ prevAnnotation = function(mView) {
*
* @return {intervalID} ID of the created interval timer
*/
slideshowAnnotations = function(mView, slideDuration = 5000) {
slideshowAnnotations = function(mView, slideDuration = 3000) {
if (slideShowInterval) {
clearInterval(slideShowInterval)
} else {
@@ -166,9 +166,18 @@ slideshowAnnotations = function(mView, slideDuration = 5000) {
* @param {ModelViewer} mView
*/
toggleAnnotations = function(mView) {
if (slideShowInterval) {
clearInterval(slideShowInterval)
const slideButton = mView.parentElement.querySelector('[toggled]')
if (slideButton) slideButton.toggleAttribute('toggled')
}
[...mView.querySelectorAll('button')].forEach( hs => {
hs.toggleAttribute('hidden')
})
const hsButtons = [...mView.parentElement.querySelectorAll('.disable-on-hide')]
hsButtons.forEach( mb => {
mb.toggleAttribute('disabled')
})
}
/**