Use the DOM Y position to restore the scroll offset. This mostly fixes Issue #1494.
This commit is contained in:
parent
110c7ae2e8
commit
88f565e03f
|
@ -180,9 +180,9 @@ class WebViewController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fullReload() {
|
func fullReload() {
|
||||||
if let offset = webView?.scrollView.contentOffset.y {
|
webView?.evaluateJavaScript("window.scrollY") { (scrollY, _) in
|
||||||
restoreOffset = Int(offset)
|
self.restoreOffset = scrollY as! Int
|
||||||
webView?.reload()
|
self.reloadHTML()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,7 +436,9 @@ private extension WebViewController {
|
||||||
// play on the iPad where we aren't constantly pushing and popping this controller.
|
// play on the iPad where we aren't constantly pushing and popping this controller.
|
||||||
if (renderingTracker > 10) {
|
if (renderingTracker > 10) {
|
||||||
reloadHTML()
|
reloadHTML()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
renderingTracker += 1
|
renderingTracker += 1
|
||||||
|
|
||||||
let style = ArticleStylesManager.shared.currentStyle
|
let style = ArticleStylesManager.shared.currentStyle
|
||||||
|
|
Loading…
Reference in New Issue