Fix for Firefox poorly scrolling to anchors
authorAlexander Ebert <ebert@woltlab.com>
Tue, 1 Apr 2014 21:14:47 +0000 (23:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 1 Apr 2014 21:14:47 +0000 (23:14 +0200)
wcfsetup/install/files/js/WCF.js

index fb1a4a7828ed851b9afd8e657c233ac76cbc0ad3..88ab6dce99efa2353a2e0b8fce1b82e3794ad237 100755 (executable)
@@ -3822,6 +3822,14 @@ WCF.TabMenu = {
                        if (!this._selectErroneousTab()) {
                                this.selectTabs();
                        }
+                       
+                       if ($.browser.mozilla && location.hash) {
+                               var $target = $(location.hash);
+                               if ($target.length && $target.hasClass('tabMenuContent')) {
+                                       var $offset = $target.offset();
+                                       window.scrollTo($offset.left, $offset.top);
+                               }
+                       }
                }
                
                this._didInit = true;