`Element.scrollTo()` is not standardized
authorAlexander Ebert <ebert@woltlab.com>
Mon, 23 Jul 2018 11:29:58 +0000 (13:29 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 23 Jul 2018 11:29:58 +0000 (13:29 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index fabd0261bafdc1dc707b2015cb10876dd0c43fec..f2f03f18c5063bd5ad8e6b868236444f43ac5394 100644 (file)
@@ -299,9 +299,11 @@ $.Redactor.prototype.WoltLabCaret = function() {
                                }
                                
                                // the scroll position is discarded when focusing the editor
-                               var scroll = { x: editor.scrollLeft, y: editor.scrollTop };
+                               var scrollLeft = editor.scrollLeft;
+                               var scrollTop = editor.scrollTop;
                                editor.focus();
-                               editor.scrollTo(scroll.x, scroll.y);
+                               editor.scrollLeft = scrollLeft;
+                               editor.scrollTop = scrollTop;
                                
                                selection.removeAllRanges();
                                selection.addRange(internalRange);