diff --git a/src/BootstrapRTE/widget/BootstrapRTE.js b/src/BootstrapRTE/widget/BootstrapRTE.js index 18e879d..12cba2f 100644 --- a/src/BootstrapRTE/widget/BootstrapRTE.js +++ b/src/BootstrapRTE/widget/BootstrapRTE.js @@ -116,6 +116,8 @@ define([ if (this.readOnly || this.get("disabled") || this.readonly || this._strReadOnly()) { this._readOnly = true; + + this._disableEditing();//in case the widget is already constructed } // set the content on update @@ -129,6 +131,16 @@ define([ this._executeCallback(callback, "update"); }, + _disableEditing: function() { + try { + $(this.inputNode).attr("contenteditable", "false"); + $("#" + this._toolbarId).find("a").addClass("disabled"); + } + catch ( e ) { + logger.debug(e); + } + }, + _setupWidget: function (callback) { logger.debug(this.id + "._setupWidget"); this._setup = true; @@ -269,8 +281,7 @@ define([ }); if (this._readOnly) { - $(this.inputNode).attr("contenteditable", "false"); - $("#" + this._toolbarId).find("a").addClass("disabled"); + this._disableEditing(); } this._addListeners(); diff --git a/test/widgets/BootstrapRTE.mpk b/test/widgets/BootstrapRTE.mpk index dd1cd96..3bb56e2 100644 Binary files a/test/widgets/BootstrapRTE.mpk and b/test/widgets/BootstrapRTE.mpk differ