*/
getText: function() {
if (this.inWysiwygMode()) {
- this.toggle();
-
- var $content = this.$source.val();
-
- this.toggle();
- return $content;
+ this.wSync();
}
return this.$source.val();
*/
submit: function() {
if (this.inWysiwygMode()) {
- this.toggle();
-
- var $content = this.$source.val();
-
- this.toggle();
-
- this.$source.val($content);
+ this.wSync();
}
this.autosavePurge();
return $string;
},
+
+ /**
+ * Synchronizes editor's source textarea.
+ */
+ wSync: function() {
+ this.$source.val(this.cleanHtml(this.$source.val()));
+ }
};