aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/style.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-02-09 21:53:24 +0000
committerGitHub <noreply@github.com>2020-02-09 21:53:24 +0000
commit8c44425665e4f1cd4fb3fa8593e960d5a518147b (patch)
tree7d7d3eb58ab402a204b5a81c3daead4fd695ade6 /src/js/utils/style.js
parentb2ac730572ad81aa9755e8b7852c53ceba0e8e9f (diff)
parent93e3f8946a0bcbca27912658d82930e4a5deb2b8 (diff)
downloadplyr-8c44425665e4f1cd4fb3fa8593e960d5a518147b.tar.lz
plyr-8c44425665e4f1cd4fb3fa8593e960d5a518147b.tar.xz
plyr-8c44425665e4f1cd4fb3fa8593e960d5a518147b.zip
Merge pull request #1679 from sampotts/develop
3.5.7
Diffstat (limited to 'src/js/utils/style.js')
-rw-r--r--src/js/utils/style.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/utils/style.js b/src/js/utils/style.js
index 941db8f2..17a033fe 100644
--- a/src/js/utils/style.js
+++ b/src/js/utils/style.js
@@ -56,11 +56,12 @@ export function setAspectRatio(input) {
return {};
}
+ const { wrapper } = this.elements;
const ratio = getAspectRatio.call(this, input);
const [w, h] = is.array(ratio) ? ratio : [0, 0];
const padding = (100 / w) * h;
- this.elements.wrapper.style.paddingBottom = `${padding}%`;
+ wrapper.style.paddingBottom = `${padding}%`;
// For Vimeo we have an extra <div> to hide the standard controls and UI
if (this.isVimeo && this.supported.ui) {
@@ -68,7 +69,7 @@ export function setAspectRatio(input) {
const offset = (height - padding) / (height / 50);
this.media.style.transform = `translateY(-${offset}%)`;
} else if (this.isHTML5) {
- this.elements.wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
+ wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
}
return { padding, ratio };