Skip to content

Commit

Permalink
Remove additional iframe padding in wysiwyg. (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly authored and tim-yao committed Jul 15, 2019
1 parent a7b5ee1 commit 280759f
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/ripple-nuxt-tide/lib/core/markup-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,7 @@ const pluginIframe = function () {
const wrapperClasses = ['rpl-markup__iframe-container']
this.find('iframe').map((i, el) => {
const iframe = this.find(el)
const height = iframe.attr('height')
const width = iframe.attr('width')
let padding = null
if (height && width) {
const aspectRatio = ((Math.round(width) / Math.round(height)) * 100).toFixed(2)
if (aspectRatio > 0) {
padding = `padding-bottom: ${aspectRatio.replace('.00', '')}%`
}
}

const markup = `<div ${padding !== null ? 'style="' + padding + '"' : ''} class="${wrapperClasses.join(' ')}"></div>`
const markup = `<div class="${wrapperClasses.join(' ')}"></div>`
return iframe.wrap(markup)
})
}
Expand Down

0 comments on commit 280759f

Please sign in to comment.