Fixed purging autosaved content upon submit
authorAlexander Ebert <ebert@woltlab.com>
Tue, 21 Oct 2014 21:00:23 +0000 (23:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 21 Oct 2014 21:00:23 +0000 (23:00 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index ed44295141a69606d445cf670231b65941f34017..5a04e5c99b1f4452ea4d69be31722176f1869cd3 100644 (file)
@@ -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);