Fixed #828: do not expand/collapse when clicking the text of a node in modes `view` or `form`

This commit is contained in:
jos 2019-10-26 10:45:37 +02:00
parent da235536bc
commit 8e15be0f12
3 changed files with 7 additions and 6 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor
## not yet published, version 7.2.1
- Fixed #828: do not expand/collapse when clicking the text of a node in modes
`view` or `form`.
## 2019-10-23, version 7.2.0
- Implemented Japanese translation (`ja`). Thanks @yutakiyama.

View File

@ -2426,8 +2426,7 @@ export class Node {
// expand events
if (type === 'click') {
if (target === dom.expand ||
((node.editor.options.mode === 'view' || node.editor.options.mode === 'form') && target.nodeName === 'DIV')) {
if (target === dom.expand) {
if (expandable) {
const recurse = event.ctrlKey // with ctrl-key, expand/collapse all
this._onExpand(recurse)

View File

@ -312,10 +312,6 @@ div.jsoneditor-value.jsoneditor-object,
div.jsoneditor-value.jsoneditor-array {
min-width: 16px;
}
div.jsoneditor-mode-view tr.jsoneditor-expandable td.jsoneditor-tree,
div.jsoneditor-mode-form tr.jsoneditor-expandable td.jsoneditor-tree {
cursor: pointer;
}
div.jsoneditor-tree button.jsoneditor-contextmenu:hover,
div.jsoneditor-tree button.jsoneditor-contextmenu:focus,
div.jsoneditor-tree button.jsoneditor-contextmenu.jsoneditor-selected,