Add call to options.onCreateMenu

to allow customisation of context menu items
This commit is contained in:
RobAley 2019-02-17 11:16:14 +00:00 committed by GitHub
parent 2bd4ca67af
commit 5d833d2131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -4372,6 +4372,10 @@ Node.prototype.showContextMenu = function (anchor, onClose) {
}
}
if (this.editor.options.onCreateMenu) {
items = this.editor.options.onCreateMenu(items, node);
}
var menu = new ContextMenu(items, {close: onClose});
menu.show(anchor, this.editor.frame);
};