diff --git a/src/js/JSONEditor.js b/src/js/JSONEditor.js index a23e769..75448d9 100644 --- a/src/js/JSONEditor.js +++ b/src/js/JSONEditor.js @@ -169,6 +169,13 @@ JSONEditor.prototype.setMode = function (mode) { } catch (err) {} } + + if (typeof options.onMode === 'function') { + try { + options.onMode(options.mode); + } + catch (err) {} + } } catch (err) { this._onError(err); diff --git a/src/js/textmode.js b/src/js/textmode.js index f505dca..0b4de12 100644 --- a/src/js/textmode.js +++ b/src/js/textmode.js @@ -23,6 +23,8 @@ var textmode = {}; * spaces. 2 by default. * {function} change Callback method * triggered on change + * {function} onMode Callback method + * triggered after setMode * {Object} ace A custom instance of * Ace editor. * @private