Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

how to use onCreateMenu to filter the menus? #12

Open
MichaelPanwenjie opened this issue Sep 12, 2022 · 2 comments
Open

how to use onCreateMenu to filter the menus? #12

MichaelPanwenjie opened this issue Sep 12, 2022 · 2 comments

Comments

@MichaelPanwenjie
Copy link

I want to delete some menus when operating, but when i use onCreateMenu function,It has no any parameter but the ordinary liberary has parameter,How can I use it?

In ordinary liberary : this.editorOptions.onCreateMenu = (items, node) => { items.filter()... }

but now:

image

Can anyone help to use onCreateMenu to filter the menus? Thanks!

@MichaelPanwenjie
Copy link
Author

onCreateMenu: function (items, node) {
// next, just for fun, let's remove any menu separators (again just at the
// top level menu). A menu separator is an item with a type : 'separator'
// property
items = items.filter(function (item) {
return item.type !== 'separator'
})

  // finally we need to return the items array. If we don't, the menu
  // will be empty.
  return items

}

How to let above codes work duo to there is no items and node parameter in the Angular Wapper?

@MaaxGr
Copy link
Owner

MaaxGr commented Sep 29, 2022

I currently don't use this library and have the time maintaining it.
Feel free to create a MR. :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants