]> BookStack Code Mirror - bookstack/blob - resources/js/editor/node-views/IframeView.js
Started work on details/summary blocks
[bookstack] / resources / js / editor / node-views / IframeView.js
1 class IframeView {
2     /**
3      * @param {PmNode} node
4      * @param {PmView} view
5      * @param {(function(): number)} getPos
6      */
7     constructor(node, view, getPos) {
8         this.dom = document.createElement('div');
9         this.dom.classList.add('ProseMirror-iframewrap');
10
11         this.iframe = document.createElement("iframe");
12         for (const [key, value] of Object.entries(node.attrs)) {
13             if (value) {
14                 this.iframe.setAttribute(key, value);
15             }
16         }
17
18         this.dom.appendChild(this.iframe);
19     }
20
21     stopEvent() {
22         return false;
23     }
24 }
25
26 export default IframeView;