Browse Source

Fix autoscroll on chrome 87 patch version

simov 4 years ago
parent
commit
f9cb7d9f25
1 changed files with 3 additions and 3 deletions
  1. 3 3
      content/index.js

+ 3 - 3
content/index.js

@@ -169,7 +169,7 @@ var scroll = (() => {
     .then(done)
   }
   function debounce (container, done) {
-    var listener = /body/i.test(container.nodeName) ? window : container
+    var listener = /html/i.test(container.nodeName) ? window : container
     var timeout = null
     listener.addEventListener('scroll', () => {
       clearTimeout(timeout)
@@ -200,10 +200,10 @@ var scroll = (() => {
         if (!loaded) {
           loaded = true
           if (state.content.scroll) {
-            listen($('body'), 'md-')
+            listen($('html'), 'md-')
           }
           else if (location.hash && $(location.hash)) {
-            $('body').scrollTop = $(location.hash).offsetTop
+            $('html').scrollTop = $(location.hash).offsetTop
           }
         }
       })