Created
December 22, 2023 13:03
-
-
Save bjoerntx/91f540ff9f960d24e85746469bdeb58f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disable the "Footnote" menu item | |
TXTextControl.addEventListener("contextMenuOpening", (e) => { | |
// check if e.items contains an entry where property text == "Insert" | |
const index = e.items.findIndex((i) => i.text === "Insert"); | |
// check if e.items[index].items contains an entry where property text == "Footnote" | |
const index2 = e.items[index].items.findIndex((i) => i.text === "Footnote"); | |
// if so, disable it | |
e.items[index].items[index2].isEnabled = false; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment