From f6f2fce422c9c8f94ee9d03f19ca64a0230bf111 Mon Sep 17 00:00:00 2001 From: Owen Garland Date: Wed, 5 Jul 2017 16:32:04 +0200 Subject: [PATCH] Enabled the default mode to be set when using a list of available modes. --- src/js/JSONEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/JSONEditor.js b/src/js/JSONEditor.js index 1cc6788..2744cda 100644 --- a/src/js/JSONEditor.js +++ b/src/js/JSONEditor.js @@ -130,7 +130,7 @@ JSONEditor.prototype._create = function (container, options, json) { this.options = options || {}; 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); };