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;