Disable hotspot buttons on hotspot hide
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -126,6 +126,11 @@
|
||||
&[toggled] {
|
||||
background: #00000033;
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
pointer-events: none;
|
||||
opacity: .3;
|
||||
}
|
||||
}
|
||||
|
||||
.prev-hs img {
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user