Fixed inserting quotes fail if editor is not visible yet
authorAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 15:51:07 +0000 (16:51 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 14 Dec 2014 15:51:07 +0000 (16:51 +0100)
wcfsetup/install/files/js/WCF.Message.js

index 609db9776ab8823283f82b6c463b98bb8e9dbaab..0500ebbdbd365007d4643c16d05c192a4873e14a 100644 (file)
@@ -2778,6 +2778,14 @@ WCF.Message.Quote.Manager = Class.extend({
                // insert into editor
                if ($.browser.redactor) {
                        if (this._editorElementAlternative === null) {
+                               if (event !== null) {
+                                       var $api = $('.jsQuickReply:eq(0)').data('__api');
+                                       if ($api && !$api.getContainer().is(':visible')) {
+                                               this._insertQuotes = false;
+                                               $api.click(null);
+                                       }
+                               }
+                               
                                this._editorElement.redactor('wbbcode.insertQuoteBBCode', $message.attr('data-username'), $message.data('link'), $quote, $quote);
                        }
                        else {
@@ -2808,14 +2816,6 @@ WCF.Message.Quote.Manager = Class.extend({
                if (event !== null) {
                        this._dialog.wcfDialog('close');
                }
-               
-               if (event !== null && this._editorElementAlternative === null) {
-                       var $api = $('.jsQuickReply:eq(0)').data('__api');
-                       if ($api && !$api.getContainer().is(':visible')) {
-                               this._insertQuotes = false;
-                               $api.click(null);
-                       }
-               }
        },
        
        /**