mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
8c8cf23bf0
* Add padding to embedded dashboards * Changelog entry * Do not check origin in iframe-resizer
22 lines
436 B
JavaScript
22 lines
436 B
JavaScript
import iframeResize from 'iframe-resizer/js/iframeResizer'
|
|
|
|
var iframes = iframeResize({
|
|
heightCalculationMethod: 'taggedElement',
|
|
onInit: onInit,
|
|
checkOrigin: false
|
|
}, '[plausible-embed]')
|
|
|
|
function onInit() {
|
|
var iframe = iframes[0]
|
|
var styles = iframe.getAttribute('styles')
|
|
|
|
if (styles) {
|
|
iframe.iFrameResizer.sendMessage({
|
|
type: 'load-custom-styles',
|
|
opts: {
|
|
styles: styles
|
|
}
|
|
})
|
|
}
|
|
}
|