eaf-browser: use document.scrollingElement.scrollTo

master
Matthew 6 years ago
parent 3921234cdf
commit 2c457ca1fe
  1. 4
      core/browser.py

@ -241,10 +241,10 @@ class BrowserView(QWebEngineView):
self.eval_js("document.scrollingElement.scrollBy({left: 0, top: -window.innerHeight/2, behavior: 'smooth'})")
def scroll_to_begin(self):
self.eval_js("window.scrollTo({left: 0, top: 0, behavior: 'smooth'})")
self.eval_js("document.scrollingElement.scrollTo({left: 0, top: 0, behavior: 'smooth'})")
def scroll_to_bottom(self):
self.eval_js("document.scrollingElement.scrollBy({left: 0, top: document.body.scrollHeight, behavior: 'smooth'})")
self.eval_js("document.scrollingElement.scrollTo({left: 0, top: document.body.scrollHeight, behavior: 'smooth'})")
def refresh_page(self):
self.reload()

Loading…
Cancel
Save