Merge pull request #424 from bag-man/feature/default-mode-from-list
Enabled the default mode to be set when using a list of available modes.
This commit is contained in:
commit
6d56b1ba76
|
@ -130,7 +130,7 @@ JSONEditor.prototype._create = function (container, options, json) {
|
||||||
this.options = options || {};
|
this.options = options || {};
|
||||||
this.json = json || {};
|
this.json = json || {};
|
||||||
|
|
||||||
var mode = this.options.mode || 'tree';
|
var mode = this.options.modes ? this.options.modes[0] : this.options.mode || 'tree';
|
||||||
this.setMode(mode);
|
this.setMode(mode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue