@glomex/glomex-dialog
Advanced tools
Comparing version 2.3.2 to 2.3.3
@@ -216,17 +216,2 @@ import { RotataToFullscreen } from './rotate-to-fullscreen.js'; | ||
function adjustLightboxModeForLandscapeOnMobile(element) { | ||
if (element.getAttribute('mode') !== 'lightbox') return; | ||
const mobileLandscapeSelector = `(max-device-width: ${PHONE_MAX_WIDTH}px) and (pointer: coarse) and (orientation: landscape)`; | ||
if (window.matchMedia(mobileLandscapeSelector).matches) { | ||
// allow scrolling in mobile landscape | ||
// so that the user can scroll down to remove the browser bar | ||
if (this._bodyStyleAdjusted) { | ||
window.document.body.style.overflow = null; | ||
} | ||
} else { | ||
window.document.body.style.overflow = 'hidden'; | ||
this._bodyStyleAdjusted = true; | ||
} | ||
} | ||
/** | ||
@@ -544,3 +529,3 @@ * A dialog web component that allows docking a video player or | ||
const onResize = () => { | ||
adjustLightboxModeForLandscapeOnMobile(this); | ||
this._adjustLightboxModeForLandscapeOnMobile(); | ||
updateViewPortWidth(this); | ||
@@ -746,3 +731,3 @@ this.refreshDockDialog(); | ||
}); | ||
adjustLightboxModeForLandscapeOnMobile(this); | ||
this._adjustLightboxModeForLandscapeOnMobile(); | ||
if (this._rotateToFullscreen) { | ||
@@ -868,2 +853,17 @@ this._rotateToFullscreen.enable(); | ||
_adjustLightboxModeForLandscapeOnMobile() { | ||
if (this.getAttribute('mode') !== 'lightbox') return; | ||
const mobileLandscapeSelector = `(max-device-width: ${PHONE_MAX_WIDTH}px) and (pointer: coarse) and (orientation: landscape)`; | ||
if (window.matchMedia(mobileLandscapeSelector).matches) { | ||
// allow scrolling in mobile landscape | ||
// so that the user can scroll down to remove the browser bar | ||
if (this._bodyStyleAdjusted) { | ||
window.document.body.style.overflow = null; | ||
} | ||
} else { | ||
window.document.body.style.overflow = 'hidden'; | ||
this._bodyStyleAdjusted = true; | ||
} | ||
} | ||
/** | ||
@@ -870,0 +870,0 @@ * Forces repositioning docked dialog element. |
{ | ||
"name": "@glomex/glomex-dialog", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "A dialog web component that allows docking a video player or putting it in a lightbox", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123328