From: Alexander Ebert Date: Mon, 1 Dec 2014 15:53:49 +0000 (+0100) Subject: Fixed extended quick reply X-Git-Tag: 2.1.0_Beta_1~108 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73640b7d4204c0ab3b301486d4177c728280b0da;p=GitHub%2FWoltLab%2FWCF.git Fixed extended quick reply --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 017af9fc2b..2baf5d6712 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -238,10 +238,12 @@ RedactorPlugins.wutil = function() { /** * Saves current editor text to local browser storage. + * + * @param boolean force */ - saveTextToStorage: function() { + saveTextToStorage: function(force) { var $content = this.wutil.getText(); - if ($autosaveLastMessage == $content) { + if ($autosaveLastMessage == $content && !force) { return; } diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index e8f8801700..c2ae4f5b13 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1067,9 +1067,16 @@ WCF.Message.QuickReply = Class.extend({ var $message = ''; if ($.browser.redactor) { $message = this._messageField.redactor('wutil.getText'); + + if ($message.length) { + this._messageField.redactor('wutil.saveTextToStorage', true); + } + else { + this._messageField.redactor('wutil.autosavePurge'); + } } else { - $message = this._messageField.val(); + $message = $.trim(this._messageField.val()); } new WCF.Action.Proxy({