Skip to content

Commit

Permalink
Fixed JSONEditor picking the first entry of modes as initial mode i…
Browse files Browse the repository at this point in the history
…nstead of option `mode`
  • Loading branch information
josdejong committed Jul 10, 2017
1 parent 15ed4da commit 7ac3f5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
https://github.com/josdejong/jsoneditor


## 2017-07-10, version 5.8.3

- Fixed #429: JSONEditor no longer accepting an empty array for option
`modes`. Thanks @trystan2k.
- Fixed JSONEditor picking the first entry of `modes` as initial mode
instead of option `mode`.


## 2017-07-08, version 5.8.2

- Select first option from `modes` instead of `tree` when `mode` is not
Expand Down
2 changes: 1 addition & 1 deletion src/js/JSONEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ JSONEditor.prototype._create = function (container, options, json) {
this.options = options || {};
this.json = json || {};

var mode = this.options.modes && this.options.modes.length > 0 ? this.options.modes[0] : this.options.mode || 'tree';
var mode = this.options.mode || (this.options.modes && this.options.modes[0]) || 'tree';
this.setMode(mode);
};

Expand Down

0 comments on commit 7ac3f5a

Please sign in to comment.