From e5ccd9beacb71d7fb2bb75e907075c9ade9e62a3 Mon Sep 17 00:00:00 2001 From: josdejong Date: Mon, 8 Jul 2013 20:29:45 +0200 Subject: [PATCH] Fixed #57: non-working option `indentation` --- HISTORY.md | 5 +++++ jsoneditor/js/texteditor.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 669ca9d..dc595d9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,11 @@ http://jsoneditoronline.org +## version 2.2.2 + +- Fixed non working option `indentation`. + + ## 2013-05-27, version 2.2.1 - Fixed undefined options in TextEditor. Thanks Wiseon3. diff --git a/jsoneditor/js/texteditor.js b/jsoneditor/js/texteditor.js index 93ee237..daef7cb 100644 --- a/jsoneditor/js/texteditor.js +++ b/jsoneditor/js/texteditor.js @@ -42,6 +42,9 @@ TextEditor.prototype._create = function (container, options, json) { if (options.indentation) { this.indentation = Number(options.indentation); } + else { + this.indentation = 4; // number of spaces + } this.mode = (options.mode == 'code') ? 'code' : 'text'; if (this.mode == 'code') { // verify whether Ace editor is available and supported @@ -61,7 +64,6 @@ TextEditor.prototype._create = function (container, options, json) { this.container = container; this.editor = undefined; // ace code editor this.textarea = undefined; // plain text editor (fallback when Ace is not available) - this.indentation = 4; // number of spaces this.width = container.clientWidth; this.height = container.clientHeight;