mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 02:59:01 +08:00
add toggleSearch event
This commit is contained in:
parent
331ba1c36b
commit
f19b5c8f34
@ -14,6 +14,10 @@ export default class Search extends Extension {
|
||||
return 'search'
|
||||
}
|
||||
|
||||
init() {
|
||||
this.editor.events.push('toggleSearch')
|
||||
}
|
||||
|
||||
get defaultOptions() {
|
||||
return {
|
||||
autoSelectNext: true,
|
||||
@ -26,6 +30,7 @@ export default class Search extends Extension {
|
||||
toggleSearch() {
|
||||
return () => {
|
||||
this.options.searching = !this.options.searching
|
||||
this.editor.emit('toggleSearch', this.options.searching)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user