This commit is contained in:
Suresh, Kamlesh 2020-08-25 19:34:25 -04:00
parent f3c3ba9799
commit dce1c5cdf2

View File

@ -129,7 +129,6 @@ extension WebView : WKUIDelegate {
return
}
/*
//TODO: Check and remove the comment
was using "document.readyState" to check the state,
while evaluateJavaScript "document.readyState",only works when webview contains userscrpt.otherwise, it would return WKErrorDomain Code=4 "A JavaScript exception occurred".
so webView.isLoading to check load finished state
@ -140,7 +139,6 @@ extension WebView : WKUIDelegate {
return
}
MVMCoreDispatchUtility.performBlock(onMainThread: { [weak self] in
let scrollHeight = webView.scrollView.contentSize.height
guard let self = self else {
return
}
@ -148,7 +146,7 @@ extension WebView : WKUIDelegate {
self.webViewHeight?.constant = height
} else {
//if failed to get height from javascript, using scrollview.contensize's height
self.webViewHeight?.constant = scrollHeight
self.webViewHeight?.constant = webView.scrollView.contentSize.height
}
self.delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
})