浏览代码

Don't fire `fullscreenchange` event on resize.

pull/707/head
Matthew Petroff 6 年前
父节点
当前提交
bcebff27d1
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. +4
    -3
      src/js/pannellum.js

+ 4
- 3
src/js/pannellum.js 查看文件

@@ -1329,7 +1329,7 @@ function onDocumentResize() {
//animateInit();

// Kludge to deal with WebKit regression: https://bugs.webkit.org/show_bug.cgi?id=93525
onFullScreenChange();
onFullScreenChange('resize');
}

/**
@@ -2105,7 +2105,7 @@ function toggleFullscreen() {
* Event handler for fullscreen changes.
* @private
*/
function onFullScreenChange() {
function onFullScreenChange(resize) {
if (document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement) {
controls.fullscreen.classList.add('pnlm-fullscreen-toggle-button-active');
fullscreenActive = true;
@@ -2113,7 +2113,8 @@ function onFullScreenChange() {
controls.fullscreen.classList.remove('pnlm-fullscreen-toggle-button-active');
fullscreenActive = false;
}
fireEvent('fullscreenchange', fullscreenActive);
if (resize !== 'resize')
fireEvent('fullscreenchange', fullscreenActive);
// Resize renderer (deal with browser quirks and fixes #155)
renderer.resize();
setHfov(config.hfov);


正在加载...
取消
保存