From: Alexander Ebert Date: Tue, 21 Oct 2014 21:00:23 +0000 (+0200) Subject: Fixed purging autosaved content upon submit X-Git-Tag: 2.1.0_Alpha_1~210 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bbbf41ee1bfe5eb2301aa1e05f07fbac1c8f099f;p=GitHub%2FWoltLab%2FWCF.git Fixed purging autosaved content upon submit --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index ed44295141..5a04e5c99b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -192,7 +192,7 @@ RedactorPlugins.wutil = function() { this.$textarea.val(this.wbbcode.convertFromHtml(this.$textarea.val())); } - this.autosavePurge(); + this.wutil.autosavePurge(); }, /** @@ -481,14 +481,30 @@ RedactorPlugins.wutil = function() { $document.trigger('resize'); }, + /** + * Sets the caret before the given element. + * + * @param Element element + */ setCaretBefore: function(element) { this.wutil._setCaret(element, true); }, + /** + * Sets the caret after the given element. + * + * @param Element element + */ setCaretAfter: function(element) { this.wutil._setCaret(element, false); }, + /** + * Sets the caret at target position. + * + * @param Element element + * @param boolean setBefore + */ _setCaret: function(element, setBefore) { var $node = $(this.opts.emptyHtml); $node[(setBefore ? 'insertBefore' : 'insertAfter')](element);