diff --git a/doc/events.md b/doc/events.md index 4471431..fb03212 100644 --- a/doc/events.md +++ b/doc/events.md @@ -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. + diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 9182711..f233249 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -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); } /**