From: Alexander Ebert Date: Mon, 30 Jun 2014 19:41:24 +0000 (+0200) Subject: Fetching text from editor no longer toggles view X-Git-Tag: 2.1.0_Alpha_1~641^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4e9241a66e884f5df4fdd2f69015f81d0ff4413d;p=GitHub%2FWoltLab%2FWCF.git Fetching text from editor no longer toggles view --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index db311e4fd0..194154397b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -148,12 +148,7 @@ RedactorPlugins.wutil = { */ getText: function() { if (this.inWysiwygMode()) { - this.toggle(); - - var $content = this.$source.val(); - - this.toggle(); - return $content; + this.wSync(); } return this.$source.val(); @@ -164,13 +159,7 @@ RedactorPlugins.wutil = { */ submit: function() { if (this.inWysiwygMode()) { - this.toggle(); - - var $content = this.$source.val(); - - this.toggle(); - - this.$source.val($content); + this.wSync(); } this.autosavePurge(); @@ -308,4 +297,11 @@ RedactorPlugins.wutil = { return $string; }, + + /** + * Synchronizes editor's source textarea. + */ + wSync: function() { + this.$source.val(this.cleanHtml(this.$source.val())); + } };