Fixed canceling of edit mode and session expired issues
authorAlexander Ebert <ebert@woltlab.com>
Tue, 10 Sep 2013 18:39:46 +0000 (20:39 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 10 Sep 2013 18:39:46 +0000 (20:39 +0200)
wcfsetup/install/files/js/WCF.Message.js

index f8e095f835fb40662a3c1bd2d0b0543d288a2e13..02c0a2f29609f9c57006851e3b1e5fa8d7b109ad 100644 (file)
@@ -1141,6 +1141,7 @@ WCF.Message.InlineEditor = Class.extend({
                                        objectID: this._container[$containerID].data('objectID')
                                }
                        });
+                       this._proxy.setOption('failure', $.proxy(function() { this._cancel(); }, this));
                        this._proxy.sendRequest();
                }
                else {
@@ -1234,8 +1235,7 @@ WCF.Message.InlineEditor = Class.extend({
                $('<span class="icon icon48 icon-spinner" />').appendTo($messageBody);
                
                var $content = $messageBody.find('.messageText');
-               this._cache = $content.html();
-               $content.empty();
+               this._cache = $content.children().detach();
                
                // hide unrelated content
                $content.parent().children('.jsInlineEditorHideContent').hide();
@@ -1299,6 +1299,9 @@ WCF.Message.InlineEditor = Class.extend({
         * @param       object          data
         */
        _showEditor: function(data) {
+               // revert failure function
+               this._proxy.setOption('failure', $.proxy(this._failure, this));
+               
                var $messageBody = this._container[this._activeElementID].addClass('jsInvalidQuoteTarget').find('.messageBody');
                $messageBody.children('.icon-spinner').remove();
                var $content = $messageBody.find('.messageText');