Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-nuxt-tide): remove max height regardless of inli…
Browse files Browse the repository at this point in the history
…ne height
  • Loading branch information
David Featherston committed May 9, 2023
1 parent 727ce4b commit e7cb696
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/ripple-nuxt-tide/lib/config/markup-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ const pluginIframe = function () {
this.find('iframe').map((i, el) => {
const iframe = this.find(el)
const wrapperClasses = ['rpl-markup__iframe-container']
// If no height setting from CMS, we give it a default height (unless it's a PowerBI embed)
// If no height setting from CMS, we give it a default height.
if (!iframe.attr('height')) {
const wrapperClass = iframe.attr('src')?.includes('powerbi.com') ? 'auto' : 'default'
wrapperClasses.push(`rpl-markup__iframe-container--${wrapperClass}`)
wrapperClasses.push('rpl-markup__iframe-container--default')
}
// If it's a PowerBI embed we remove the max-height setting.
if (iframe.attr('src')?.includes('powerbi.com')) {
wrapperClasses.push(`rpl-markup__iframe-container--auto`)
}
const markup = `<div class="${wrapperClasses.join(' ')}"></div>`
return iframe.wrap(markup)
Expand Down

0 comments on commit e7cb696

Please sign in to comment.