Skip to content

Commit

Permalink
🐛 Fix ratio issues if preserve ratio is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Jan 28, 2021
1 parent 0565dc1 commit 567fc5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Resources/Private/Fusion/Component/Attributes.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Component.Attributes) < prototype(N
modifier = Neos.Fusion:DataStructure {
platform = ${props.platform}
iframe = true
ratio = ${!!props.force16to9 || !!props.hasRatioAndNoLightboxWithPreserveAspectRatio}
ratio = ${props.hasLightboxWithPreserveAspectRatio ? null : !!props.finalRatio}
look = ${props.look}
}
}
href = ${String.replace(props.url.href, '%id%', props.videoID)}
rel = 'noopener'
target = '_blank'
style = ${props.force16to9 || props.hasRatioAndNoLightboxWithPreserveAspectRatio ? 'padding-top:' + props.forceRatio : null}
style = ${!props.hasLightboxWithPreserveAspectRatio && props.finalRatio ? 'padding-top:' + props.finalRatio : null}
aria-label = ${props.metadataTitle}
data-gdpr = ${props.enableGdprMessage && props.gdprMessage ? props.gdprMessage : null}
data-ratio = ${props.forceRatio || null}
data-ratio = ${props.finalRatio || null}
data-fs = ${!!props.allowFullScreen}
data-embed = Neos.Fusion:Case {
isVimeo {
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Fusion/Component/Video/Video.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ prototype(Jonnitto.PrettyEmbedVideoPlatforms:Component.Video) < prototype(Neos.F
isYouTube = ${this.platform == 'youtube'}
look = ${this.lightbox ? 'lightbox' : 'inline'}
url = ${this.isYouTube ? this.configuration.youtube[this.type] : this.configuration[this.platform]}
hasRatioAndNoLightboxWithPreserveAspectRatio = ${this.lightbox && this.preserveAspectRatio ? false : !!this.ratio}
forceRatio = ${Jonnitto.PrettyEmbedHelper.paddingTop(this.ratio || this.force16to9)}
hasLightboxWithPreserveAspectRatio = ${this.lightbox && this.preserveAspectRatio}
finalRatio = ${Jonnitto.PrettyEmbedHelper.paddingTop(this.ratio || this.force16to9)}

previewImageClass = ${!this.poster && this.isYouTube ? 'jonnitto-prettyembed__youtube-preview' : null}
posterFromYoutube = ${this.isYouTube && this.type == 'video' && !this.poster ? '//i.ytimg.com/vi/' + this.videoID + '/maxresdefault.jpg' : null}
Expand Down

0 comments on commit 567fc5f

Please sign in to comment.