Fixed direct quote insert
authorAlexander Ebert <ebert@woltlab.com>
Fri, 19 Aug 2016 14:29:13 +0000 (16:29 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 19 Aug 2016 14:29:13 +0000 (16:29 +0200)
wcfsetup/install/files/js/WCF.Message.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js

index ea4ddc05b7e37c1a621013112200e0085cec9619..43152409af4565314211eb33245b440e861f9102 100644 (file)
@@ -1604,6 +1604,16 @@ WCF.Message.Quote.Manager = Class.extend({
                this._toggleShowQuotes();
                
                WCF.System.Event.addListener('com.woltlab.wcf.quote', 'reload', this.countQuotes.bind(this));
+               
+               // event forwarding
+               WCF.System.Event.addListener('com.woltlab.wcf.message.quote', 'insert', (function(data) {
+                       WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'insertQuote_' + (this._editorIdAlternative ? this._editorIdAlternative : this._editorId), {
+                               author: data.quote.username,
+                               content: data.quote.text,
+                               isText: true,
+                               link: data.quote.link
+                       });
+               }).bind(this));
        },
        
        /**
index e89bf943c5c39729477412248b11f188918352f0..44409166e97ab371f79592716bd4e3265a27b2d4 100644 (file)
@@ -96,7 +96,7 @@ define(['Core', 'EventHandler', 'EventKey', 'Language', 'StringUtil', 'Dom/Util'
                        elData(quote, 'link', data.link);
                        
                        if (data.isText) {
-                               this.insert.text(data.content);
+                               this._editor.insert.text(data.content);
                        }
                        
                        quote.removeAttribute('id');