mirror of
https://github.com/standardnotes/app.git
synced 2026-01-11 19:56:41 +00:00
15 lines
520 B
TypeScript
15 lines
520 B
TypeScript
import { WebContents } from 'electron'
|
|
import { SearchManagerInterface } from './SearchManagerInterface'
|
|
|
|
export function initializeSearchManager(webContents: WebContents): SearchManagerInterface {
|
|
return {
|
|
findInPage(text: string) {
|
|
webContents.stopFindInPage('clearSelection')
|
|
if (text && text.length > 0) {
|
|
// This option arrangement is required to avoid an issue where clicking on a
|
|
// different note causes scroll to jump.
|
|
webContents.findInPage(text)
|
|
}
|
|
},
|
|
}
|
|
}
|