Browse Source

Add `zoomchange`, `fullscreenchange` event fired

pull/663/head
Jutinidlerz 6 years ago
committed by Matthew Petroff
parent
commit
f6ceb462a7
2 changed files with 10 additions and 3 deletions
  1. +8
    -1
      doc/events.md
  2. +2
    -2
      src/js/pannellum.js

+ 8
- 1
doc/events.md View File

@@ -10,13 +10,19 @@ Fired when a panorama finishes loading.
Fired when a scene change is initiated. A `load` event will be fired when the
new scene finishes loading. Passes scene ID string to handler.

## `fullscreenchange`

Fired when browser fullscreen status changed, Passes status boolean to handler.

## `zoomchange`

Fired when scene hfov update, Passes new hfov value to handler.

## `scenechangefadedone`

If a scene transition fade interval is specified, this event is fired when the
fading is completed after changing scenes.


## `error`

Fired when an error occured. The error message string is passed to the
@@ -46,3 +52,4 @@ Fired when a touch starts. Passes `TouchEvent` to handler.
## `touchend`

Fired when a touch ends. Passes `TouchEvent` to handler.


+ 2
- 2
src/js/pannellum.js View File

@@ -1000,7 +1000,6 @@ function onDocumentMouseWheel(event) {
setHfov(config.hfov + event.detail * 1.5);
speed.hfov = event.detail > 0 ? 1 : -1;
}
animateInit();
}

@@ -2113,7 +2112,7 @@ function onFullScreenChange() {
controls.fullscreen.classList.remove('pnlm-fullscreen-toggle-button-active');
fullscreenActive = false;
}
fireEvent('fullscreenchange', fullscreenActive);
// Resize renderer (deal with browser quirks and fixes #155)
renderer.resize();
setHfov(config.hfov);
@@ -2185,6 +2184,7 @@ function constrainHfov(hfov) {
*/
function setHfov(hfov) {
config.hfov = constrainHfov(hfov);
fireEvent('zoomchange', config.hfov);
}

/**


Loading…
Cancel
Save