Browse Source

Add `zoomchange`, `fullscreenchange` event fired

pull/652/head
Jutinidlerz 6 years ago
committed by Justinidlerz
parent
commit
7ccf12ed28
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 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. 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` ## `scenechangefadedone`


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



## `error` ## `error`


Fired when an error occured. The error message string is passed to the 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` ## `touchend`


Fired when a touch ends. Passes `TouchEvent` to handler. 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); setHfov(config.hfov + event.detail * 1.5);
speed.hfov = event.detail > 0 ? 1 : -1; speed.hfov = event.detail > 0 ? 1 : -1;
} }
animateInit(); animateInit();
} }


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


/** /**


Loading…
Cancel
Save