Fixed #826: editor not allowing indentation `0`

This commit is contained in:
jos 2019-10-26 10:51:40 +02:00
parent 8e15be0f12
commit 43e0c129ec
3 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ https://github.com/josdejong/jsoneditor
- Fixed #828: do not expand/collapse when clicking the text of a node in modes - Fixed #828: do not expand/collapse when clicking the text of a node in modes
`view` or `form`. `view` or `form`.
- Fixed #826: editor not allowing indentation `0`.
## 2019-10-23, version 7.2.0 ## 2019-10-23, version 7.2.0

View File

@ -47,7 +47,7 @@ previewmode.create = function (container, options = {}) {
this.options = options this.options = options
// indentation // indentation
if (options.indentation) { if (typeof options.indentation === 'number') {
this.indentation = Number(options.indentation) this.indentation = Number(options.indentation)
} else { } else {
this.indentation = 2 // number of spaces this.indentation = 2 // number of spaces

View File

@ -49,7 +49,7 @@ textmode.create = function (container, options = {}) {
this.options = options this.options = options
// indentation // indentation
if (options.indentation) { if (typeof options.indentation === 'number') {
this.indentation = Number(options.indentation) this.indentation = Number(options.indentation)
} else { } else {
this.indentation = 2 // number of spaces this.indentation = 2 // number of spaces