瀏覽代碼

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 9 年之前
父節點
當前提交
53568ba239
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      src/js/pannellum.js

+ 3
- 1
src/js/pannellum.js 查看文件

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


Loading…
取消
儲存