josdejong/jsoneditor

Attach custom classnames to the DOM root of a node instead of nested inside

Open

#1.088 geöffnet am 17. Aug. 2020

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.034 Forks)batch import
featurehelp wanted

Repository-Metriken

Stars
 (10.781 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 15h 36m) (3 gemergte PRs in 30 T)

Beschreibung

Another small suggestion for a neater design! Would be fantastic for the onCreateMenu callback to be able to return undefined and have the rendering of the context menu icon skipped or set to display:none. This way the tree view can more easily convey at a glance which of the elements may have context actions for those of us that are replacing the menu with our own actions.

JSONEditorOptions.onCreateMenu?: ((menuItems: MenuItem[], node: MenuItemNode) => MenuItem[]) | undefined
=>
JSONEditorOptions.onCreateMenu?: ((menuItems: MenuItem[], node: MenuItemNode) => MenuItem[] | undefined) | undefined

Alternatively, an isEmpty check of the MenuItem array would do the same job.

Cheers!

Contributor Guide