From 8e15be0f12791398331dc23e8abfd207b2bcd933 Mon Sep 17 00:00:00 2001 From: jos Date: Sat, 26 Oct 2019 10:45:37 +0200 Subject: [PATCH] Fixed #828: do not expand/collapse when clicking the text of a node in modes `view` or `form` --- HISTORY.md | 6 ++++++ src/js/Node.js | 3 +-- src/scss/jsoneditor.scss | 4 ---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 317c029..f3c7b90 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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. diff --git a/src/js/Node.js b/src/js/Node.js index 8e780f6..c183f3d 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -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) diff --git a/src/scss/jsoneditor.scss b/src/scss/jsoneditor.scss index 3fa70c6..db83e47 100644 --- a/src/scss/jsoneditor.scss +++ b/src/scss/jsoneditor.scss @@ -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,