From 0c94c594f15ccde891f634ebf2881cda0346eb2d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 11 Dec 2016 11:56:31 +0100 Subject: [PATCH] Work-around for stuck autosave notice --- com.woltlab.wcf/templates/wysiwyg.tpl | 14 ++++++++++++++ wcfsetup/install/files/acp/templates/wysiwyg.tpl | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 26621f0e5e..b9d0f8b697 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -259,6 +259,20 @@ // set value redactor.core.textarea().val(redactor.clean.onSync(redactor.$editor.html())); + + // work-around for autosave notice being stuck + window.setTimeout(function() { + var autosaveNotice = elBySel('.redactorAutosaveRestored.active', element.parentNode); + if (autosaveNotice) { + autosaveNotice.style.setProperty('position', 'static', ''); + + // force layout + //noinspection BadExpressionStatementJS + autosaveNotice.offsetTop; + + autosaveNotice.style.removeProperty('position'); + } + }, 10); }, 10); }; diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 26621f0e5e..b9d0f8b697 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -259,6 +259,20 @@ // set value redactor.core.textarea().val(redactor.clean.onSync(redactor.$editor.html())); + + // work-around for autosave notice being stuck + window.setTimeout(function() { + var autosaveNotice = elBySel('.redactorAutosaveRestored.active', element.parentNode); + if (autosaveNotice) { + autosaveNotice.style.setProperty('position', 'static', ''); + + // force layout + //noinspection BadExpressionStatementJS + autosaveNotice.offsetTop; + + autosaveNotice.style.removeProperty('position'); + } + }, 10); }, 10); }; -- 2.20.1