Skip to content

Commit

Permalink
Merge pull request crabbly#478 from OlesyaKlochko/fix/IE-targetstyles…
Browse files Browse the repository at this point in the history
…-bug

Fix/ie targetstyles bug
  • Loading branch information
crabbly authored Sep 17, 2020
2 parents 6fd3d15 + d74647c commit 80c93e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export function collectStyles (element, params) {
// Loop over computed styles
const styles = win.getComputedStyle(element, '')

Object.keys(styles).map(key => {
for (let key = 0; key < styles.length; key++) {
// Check if style should be processed
if (params.targetStyles.indexOf('*') !== -1 || params.targetStyle.indexOf(styles[key]) !== -1 || targetStylesMatch(params.targetStyles, styles[key])) {
if (styles.getPropertyValue(styles[key])) elementStyle += styles[key] + ':' + styles.getPropertyValue(styles[key]) + ';'
}
})
}

// Print friendly defaults (deprecated)
elementStyle += 'max-width: ' + params.maxWidth + 'px !important;' + params.font_size + ' !important;'
Expand Down

0 comments on commit 80c93e3

Please sign in to comment.