active: ($autosave) ? true : false,
key: ($autosave) ? '{@$__wcf->getAutosavePrefix()}_' + $autosave : '',
saveOnInit: {if !$errorField|empty}true{else}false{/if}
- }
+ },
+ wOriginalValue: $textarea.val()
};
{event name='javascriptInit'}
*/
init: function() {
this.opts.initCallback = $.proxy(function() {
- if (this.$source.val().length) {
+ // use stored editor contents
+ var $content = $.trim(this.getOption('wOriginalValue'));
+ if ($content.length) {
this.toggle();
+ this.$source.val($content);
this.toggle();
}
+
+ delete this.opts.wOriginalValue;
}, this);
this.opts.pasteBeforeCallback = $.proxy(this._wPasteBeforeCallback, this);