mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-25 00:15:28 +01:00
Move live-resize handler from detail container to DetailWebView, where it belongs.
This commit is contained in:
parent
28466a3fea
commit
104445c413
@ -108,16 +108,6 @@ final class DetailViewController: NSViewController, WKUIDelegate {
|
||||
let timelineArticles = userInfo[UserInfoKey.articles] as? ArticleArray
|
||||
articles = timelineArticles
|
||||
}
|
||||
|
||||
func viewWillStartLiveResize() {
|
||||
|
||||
webview.evaluateJavaScript("document.body.style.overflow = 'hidden';", completionHandler: nil)
|
||||
}
|
||||
|
||||
func viewDidEndLiveResize() {
|
||||
|
||||
webview.evaluateJavaScript("document.body.style.overflow = 'visible';", completionHandler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: WKNavigationDelegate
|
||||
@ -236,14 +226,6 @@ final class DetailContainerView: NSView {
|
||||
}
|
||||
}
|
||||
|
||||
override func viewWillStartLiveResize() {
|
||||
viewController?.viewWillStartLiveResize()
|
||||
}
|
||||
|
||||
override func viewDidEndLiveResize() {
|
||||
viewController?.viewDidEndLiveResize()
|
||||
}
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
NSColor.textBackgroundColor.setFill()
|
||||
dirtyRect.fill()
|
||||
|
@ -36,6 +36,15 @@ final class DetailWebView: WKWebView {
|
||||
evaluateJavaScript("document.getElementById('bodyId').className = '\(bodyClass)'")
|
||||
}
|
||||
|
||||
override func viewWillStartLiveResize() {
|
||||
super.viewWillStartLiveResize()
|
||||
evaluateJavaScript("document.body.style.overflow = 'hidden';", completionHandler: nil)
|
||||
}
|
||||
|
||||
override func viewDidEndLiveResize() {
|
||||
super.viewDidEndLiveResize()
|
||||
evaluateJavaScript("document.body.style.overflow = 'visible';", completionHandler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
private extension NSUserInterfaceItemIdentifier {
|
||||
|
Loading…
Reference in New Issue
Block a user