Properly reset editor content on reset event
authorAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 10:34:04 +0000 (12:34 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 8 Jun 2016 10:34:04 +0000 (12:34 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js

index 31c3cbdaa3a4d69224dfcba95672b78790333b58..9ef9749d2475f7a26569964d199607d8cba9ef27 100644 (file)
@@ -36,6 +36,11 @@ $.Redactor.prototype.WoltLabEvent = function() {
                        EventHandler.add('com.woltlab.wcf.redactor2', 'getText_' + elementId, (function(data) {
                                data.message = this.code.get();
                        }).bind(this));
+                       
+                       // clear editor content on reset
+                       EventHandler.add('com.woltlab.wcf.redactor2', 'reset_' + elementId, (function() {
+                               this.code.set('');
+                       }).bind(this));
                },
                
                register: function(callbackName, callback) {