Pārlūkot izejas kodu

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 pirms 9 gadiem
vecāks
revīzija
53568ba239
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. +3
    -1
      src/js/pannellum.js

+ 3
- 1
src/js/pannellum.js Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt