@glomex/glomex-dialog
Advanced tools
Comparing version 1.10.2 to 1.10.3
@@ -81,3 +81,3 @@ const NON_VISIBLE_WIDTH = window.innerWidth < 720 ? 320 : 640; | ||
element.style.height = `${height}px`; | ||
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { | ||
if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { | ||
// somehow safari animates to the wrong position initially | ||
@@ -93,7 +93,7 @@ // and then snaps into place when the aspect-ratio is not stable | ||
window.requestAnimationFrame(() => { | ||
const deltaX = toRect.left - fromRect.left; | ||
const deltaY = toRect.top - fromRect.top; | ||
const deltaScale = toRect.width / width; | ||
const deltaX = toRect.left - fromRect.left; | ||
const deltaY = toRect.top - fromRect.top; | ||
const deltaScale = toRect.width / width; | ||
const moveDialog = () => { | ||
element.style.height = `${toHeight}px`; | ||
@@ -119,7 +119,17 @@ element.style.transform = `translate(${(deltaX / width) * 100}%, ${(deltaY / toHeight) * 100}%) scale(${deltaScale})`; | ||
} | ||
window.requestAnimationFrame(() => { | ||
resolve({ | ||
scale: downscale ? deltaScale : 1, | ||
}); | ||
}; | ||
if (!animate) { | ||
moveDialog(); | ||
resolve({ | ||
scale: downscale ? deltaScale : 1, | ||
}); | ||
return; | ||
} | ||
window.requestAnimationFrame(() => { | ||
moveDialog(); | ||
resolve({ | ||
scale: downscale ? deltaScale : 1, | ||
}); | ||
}); | ||
@@ -491,3 +501,7 @@ }); | ||
downscale: this.getAttribute('dock-downscale'), | ||
}).then(goToInline); | ||
}).then(() => { | ||
window.requestAnimationFrame(() => { | ||
goToInline(); | ||
}); | ||
}); | ||
} else if (oldValue !== 'inline') { | ||
@@ -494,0 +508,0 @@ goToInline(); |
{ | ||
"name": "@glomex/glomex-dialog", | ||
"version": "1.10.2", | ||
"version": "1.10.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
101853
829