mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-23 03:32:13 -04:00
Fix Find in page availability
This commit is contained in:
parent
7075ec0c11
commit
57a8f4ea92
@ -212,7 +212,7 @@ private struct Content: View {
|
||||
systemImage: "die.face.5",
|
||||
action: { browser.loadRandomArticle() })
|
||||
.disabled(zimFiles.isEmpty)
|
||||
ContentSearchButton(webView: browser.webView)
|
||||
ContentSearchButton()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ struct BrowserTab: View {
|
||||
#endif
|
||||
BookmarkButton()
|
||||
#if os(iOS)
|
||||
ContentSearchButton(webView: browser.webView)
|
||||
ContentSearchButton()
|
||||
#endif
|
||||
ArticleShortcutButtons(displayMode: .mainAndRandomArticle)
|
||||
}
|
||||
|
@ -19,16 +19,16 @@ import WebKit
|
||||
|
||||
struct ContentSearchButton: View {
|
||||
|
||||
let webView: WKWebView
|
||||
@EnvironmentObject private var browser: BrowserViewModel
|
||||
|
||||
var body: some View {
|
||||
Button("common.search".localized,
|
||||
systemImage: "text.magnifyingglass",
|
||||
action: {
|
||||
webView.isFindInteractionEnabled = true
|
||||
webView.findInteraction?.presentFindNavigator(showingReplace: false)
|
||||
browser.webView.isFindInteractionEnabled = true
|
||||
browser.webView.findInteraction?.presentFindNavigator(showingReplace: false)
|
||||
}
|
||||
).disabled(webView.url == nil)
|
||||
).disabled(browser.url == nil)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user