Browse Source

standalone.js: dispatch pannellumloaded event

pull/1140/head
Trey Smith 1 year ago
parent
commit
82e9b20bbd
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/standalone/standalone.js

+ 8
- 0
src/standalone/standalone.js View File

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


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

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


// Display error if opened from local file // Display error if opened from local file


Loading…
Cancel
Save