Resolved a few issues
authorAlexander Ebert <ebert@woltlab.com>
Mon, 24 Nov 2014 11:36:15 +0000 (12:36 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 24 Nov 2014 11:36:15 +0000 (12:36 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index c83b6db2407da5908c7767edbcb727587cc6a9fc..7e1fc8dbbfe6b26c69a11720d990e744b951049f 100644 (file)
@@ -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();
index 24bc91d231d6dbcdd777cca2a31754807cad26db..1af00db479190a359c1fde944e0bac092f245e33 100644 (file)
@@ -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;