From 6fced0cc033d92107986812aa6344bcaf2c12368 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 20 May 2017 22:21:05 +0200 Subject: [PATCH] Force hide autosave overlay on editor reset --- .../files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js index b9ee16553c..d68741d6ce 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js @@ -7,7 +7,7 @@ * @license GNU Lesser General Public License * @module WoltLabSuite/Core/Ui/Redactor/Autosave */ -define(['Language', 'Dom/Traverse', './Metacode'], function(Language, DomTraverse, UiRedactorMetacode) { +define(['EventHandler', 'Language', 'Dom/Traverse', './Metacode'], function(EventHandler, Language, DomTraverse, UiRedactorMetacode) { "use strict"; // time between save requests in seconds @@ -47,6 +47,9 @@ define(['Language', 'Dom/Traverse', './Metacode'], function(Language, DomTravers if (form !== null) { form.addEventListener('submit', this.destroy.bind(this)); } + + // clear editor content on reset + EventHandler.add('com.woltlab.wcf.redactor2', 'reset_' + this._element.id, this.hideOverlay.bind(this)); }, /** -- 2.20.1