Explorar el Código

Fix undefined error when moving too fast

If we are switching from one image to another too fast, oldRenderer is undefined at that point. This fix that.
pull/72/head
Didac hace 9 años
padre
commit
53568ba239
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      src/js/pannellum.js

+ 3
- 1
src/js/pannellum.js Ver fichero

@@ -948,7 +948,9 @@ function renderInitCallback() {
oldRenderer.fadeImg.style.opacity = 0;
// Remove image
setTimeout(function() {
renderContainer.removeChild(oldRenderer.fadeImg);
if(oldRenderer && oldRenderer.fadeImg){
renderContainer.removeChild(oldRenderer.fadeImg);
}
oldRenderer = undefined;
}, config.sceneFadeDuration);
}


Cargando…
Cancelar
Guardar