Completed
Branch master (28f58d)
by Michael
02:42
created

script/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