josdejong/jsoneditor

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

開放

#1,088 建立於 2020年8月17日

 (10 則留言) (0 個反應) (0 位負責人)JavaScript (2,078 個分叉)batch import
featurehelp wanted

倉庫指標

星標
 (12,263 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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!

貢獻者指南