Sha256: ff90c405a51a2835fceb7d2b5dd5b47dec76337008d071061b5942bf1136804e
Contents?: true
Size: 844 Bytes
Versions: 41
Compression:
Stored size: 844 Bytes
Contents
import "iframe-resizer/js/iframeResizer"; export default function embedComponent(id, embedStore) { if (!embedStore[id]) { embedStore[id] = { width: "100%", height: "100%" }; } return { tab: "preview", resizer: null, get store() { return embedStore[id]; }, async loadResizer() { window.iFrameResize( { heightCalculationMethod: "lowestElement", }, this.$el.querySelector("iframe") ); this.resizer = this.$el.querySelector("iframe").iFrameResizer; this.resizer.resize(); this.$dispatch("embed:resizer-loaded", { resizer: this.resizer }); }, resizeIframe() { this.$el.querySelector("iframe").iFrameResizer.resize(); }, cleanup() { if (this.resizer) { this.resizer.removeListeners(); } }, }; }
Version data entries
41 entries across 41 versions & 1 rubygems