[Depends On]: RTE accessors improvements
const rteInstance = $editor.data(RTE_DATA_INSTANCE);
$rteContainer.find(RTE_INPUT_SELECTOR).val(value);
- if (rteInstance && typeof rteInstance.setContent === 'function') {
+ if (rteInstance && rteInstance.isActive && typeof rteInstance.setContent === 'function') {
rteInstance.setContent(value);
}
-
+ if (rteInstance && !rteInstance.isActive && typeof rteInstance.getTextDiv === 'function') {
+ rteInstance.getTextDiv(rteInstance.$element).html(value);
+ }
notify && $editor.trigger('change');
},
required: function ($el, val) {
if (!rteInstance) return;
// disable rte editing
+ setTimeout(function () {
if (val) {
rteInstance.suspend();
} else {
const initContent = rteInstance.editorKernel && rteInstance.editorKernel.getProcessedHtml();
rteInstance.reactivate(initContent);
}
+ }, 100);
}
});
})(Granite.$, Granite.DependsOnPlugin = (Granite.DependsOnPlugin || {}));
\ No newline at end of file
