From ddcef1e3864f34e0a4709bf552fe2a077d985698 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 24 Nov 2014 12:36:15 +0100 Subject: [PATCH] Resolved a few issues --- .../files/js/3rdParty/redactor/plugins/wmonkeypatch.js | 10 ++++++++++ .../files/js/3rdParty/redactor/plugins/wutil.js | 8 +++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index c83b6db240..7e1fc8dbbf 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -434,6 +434,8 @@ RedactorPlugins.wmonkeypatch = function() { // bug report: https://code.google.com/p/chromium/issues/detail?id=335955 // based upon the idea: http://www.neotericdesign.com/blog/2013/3/working-around-chrome-s-contenteditable-span-bug var $fixWebKit = (function() { + var $removedSpan = false; + this.$editor.find('span').each(function() { var $span = $(this); if ($span.data('verified') !== 'redactor') { @@ -443,8 +445,14 @@ RedactorPlugins.wmonkeypatch = function() { $helper.remove(); $span.remove(); + + $removedSpan = true; } }); + + if ($removedSpan) { + this.wmonkeypatch.saveSelection(); + } }).bind(this); // insert.html @@ -454,6 +462,8 @@ RedactorPlugins.wmonkeypatch = function() { $mpHtml.call(this, html, clean); + this.wmonkeypatch.saveSelection(); + if ($isWebKit) { setTimeout(function() { $fixWebKit(); diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 24bc91d231..1af00db479 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -397,11 +397,9 @@ RedactorPlugins.wutil = function() { return; } - $autosaveNotice.data('callbackOpen', function() { - setTimeout(function() { - $autosaveNotice.removeClass('open'); - }, 3000); - }); + setTimeout(function() { + $autosaveNotice.removeClass('open'); + }, 2000); $message = WCF.Language.get('wcf.message.autosave.saved'); break; -- 2.20.1