瀏覽代碼

standalone.js: dispatch pannellumloaded event

pull/1140/head
Trey Smith 1 年之前
父節點
當前提交
82e9b20bbd
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. +8
    -0
      src/standalone/standalone.js

+ 8
- 0
src/standalone/standalone.js 查看文件

@@ -10,6 +10,12 @@ function anError(error, showHTML) {
document.getElementById('container').appendChild(errorMsg);
}

function dispatchLoaded(configFromURL) {
var event = new Event('pannellumloaded');
event.configFromURL = configFromURL;
document.dispatchEvent(event);
}

var viewer;
function parseURLParameters() {
var URL;
@@ -113,6 +119,7 @@ function parseURLParameters() {
// Create viewer
configFromURL.escapeHTML = true;
viewer = pannellum.viewer('container', configFromURL);
dispatchLoaded(configFromURL);
};
request.open('GET', configFromURL.config);
request.send();
@@ -127,6 +134,7 @@ function parseURLParameters() {
configFromURL.escapeHTML = true;
configFromURL.targetBlank = true;
viewer = pannellum.viewer('container', configFromURL);
dispatchLoaded(configFromURL);
}

// Display error if opened from local file


Loading…
取消
儲存