Browse Source

Update pannellum.js

pull/1132/head
the-ft 1 year ago
committed by GitHub
parent
commit
418d2fc662
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      src/js/pannellum.js

+ 11
- 3
src/js/pannellum.js View File

@@ -103,6 +103,7 @@ var defaultConfig = {
showZoomCtrl: true,
autoLoad: false,
showControls: true,
workaroundFullscreen: true,
orientationOnByDefault: false,
hotSpotDebug: false,
backgroundColor: [0, 0, 0],
@@ -259,7 +260,7 @@ controls.container.appendChild(controls.zoom);
controls.fullscreen = document.createElement('div');
controls.fullscreen.addEventListener('click', toggleFullscreen);
controls.fullscreen.className = 'pnlm-fullscreen-toggle-button pnlm-sprite pnlm-fullscreen-toggle-button-inactive pnlm-controls pnlm-control';
if (document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled)
if (document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled || config.workaroundFullscreen))
controls.container.appendChild(controls.fullscreen);

// Device orientation toggle
@@ -2266,8 +2267,8 @@ function processOptions(isPreview) {
break;

case 'showFullscreenCtrl':
if (config[key] && config.showControls != false && ('fullscreen' in document || 'mozFullScreen' in document ||
'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {
if (config[key] && config.showControls != false && (('fullscreen' in document || 'mozFullScreen' in document ||
'webkitIsFullScreen' in document || 'msFullscreenElement' in document) || config.workaroundFullscreen) ) {
// Show fullscreen control
controls.fullscreen.style.display = 'block';
@@ -2319,6 +2320,13 @@ function processOptions(isPreview) {
*/
function toggleFullscreen() {
if (loaded && !error) {
if (container.classList.contains("pnlm-workaroundfullscreen")) {
container.classList.remove("pnlm-workaroundfullscreen");
} else {
container.classList.add("pnlm-workaroundfullscreen");
}
if (!fullscreenActive) {
try {
if (container.requestFullscreen) {


Loading…
Cancel
Save