Passed
Push — master ( 4e6573...d5fcc5 )
by Michael
02:15
created

script/Menu/MenuPlugin.js   A

Size

Lines of Code 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
rs 10
noi 0
1
const { Plugin } = require('prosemirror-state');
2
const { MenuView } = require('./MenuView');
3
4
function MenuPlugin(items) {
5
    return new Plugin({
6
        view(editorView) {
7
            const menuView = new MenuView(items, editorView);
8
            editorView.dom.parentNode.insertBefore(menuView.dom, editorView.dom);
9
            return menuView;
10
        },
11
    });
12
}
13
14
exports.MenuPlugin = MenuPlugin;
15