From: Alexander Ebert Date: Wed, 1 Jul 2015 13:06:18 +0000 (+0200) Subject: Force sync on unload, otherwise back navigation breaks everything X-Git-Tag: 2.1.6~26 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78c7caf5e50ddc73518a50ab1107752bfc1e6ba3;p=GitHub%2FWoltLab%2FWCF.git Force sync on unload, otherwise back navigation breaks everything --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 77219f87f0..2449b85dd1 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -20,10 +20,16 @@ RedactorPlugins.wbbcode = function() { var $identifier = this.$textarea.wcfIdentify(); this.opts.initCallback = (function() { + window.addEventListener('unload', (function(event) { + this.code.startSync(); + + this.$textarea.val(this.wbbcode.convertFromHtml(this.$textarea.val())); + }).bind(this)); + if ($.browser.msie) { this.$editor.addClass('msie'); } - + this.$textarea[0].setAttribute('data-is-dirty', true); // use stored editor contents var $content = $.trim(this.wutil.getOption('woltlab.originalValue')); if ($content.length) {