Fixed message inline editing
authorAlexander Ebert <ebert@woltlab.com>
Sun, 1 May 2016 12:11:09 +0000 (14:11 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 1 May 2016 12:11:35 +0000 (14:11 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js
wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js

index 21d6e8a03d5466713cfbf2a4462497e7fb2228ce..31c3cbdaa3a4d69224dfcba95672b78790333b58 100644 (file)
@@ -31,6 +31,11 @@ $.Redactor.prototype.WoltLabEvent = function() {
                                
                                return (data.cancel === false);
                        };
+                       
+                       // provide editor message on callback
+                       EventHandler.add('com.woltlab.wcf.redactor2', 'getText_' + elementId, (function(data) {
+                               data.message = this.code.get();
+                       }).bind(this));
                },
                
                register: function(callbackName, callback) {
index a738227dd099102f78c1287c1ad3a3708ef26a60..3cce87563dfb6eba8191c5cc1daf9ff9795ef09f 100644 (file)
@@ -417,7 +417,8 @@ define(
                        };
                        
                        var id = this._getEditorId();
-                       EventHandler.fire('com.woltlab.wcf.redactor', 'getText_' + id, parameters.data);
+                       
+                       EventHandler.fire('com.woltlab.wcf.redactor2', 'getText_' + id, parameters.data);
                        EventHandler.fire('com.woltlab.wcf.messageOptionsInline', 'submit_' + id, parameters);
                        
                        Ajax.api(this, {