Procházet zdrojové kódy

Add `zoomchange`, `fullscreenchange` event fired

pull/652/head
Jutinidlerz před 6 roky
committed by Justinidlerz
rodič
revize
7ccf12ed28
2 změnil soubory, kde provedl 10 přidání a 3 odebrání
  1. +8
    -1
      doc/events.md
  2. +2
    -2
      src/js/pannellum.js

+ 8
- 1
doc/events.md Zobrazit soubor

@@ -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 Zobrazit soubor

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

@@ -2107,7 +2106,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);
@@ -2179,6 +2178,7 @@ function constrainHfov(hfov) {
*/
function setHfov(hfov) {
config.hfov = constrainHfov(hfov);
fireEvent('zoomchange', config.hfov);
}

/**


Načítá se…
Zrušit
Uložit