mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 11:09: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'
|
return 'search'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.editor.events.push('toggleSearch')
|
||||||
|
}
|
||||||
|
|
||||||
get defaultOptions() {
|
get defaultOptions() {
|
||||||
return {
|
return {
|
||||||
autoSelectNext: true,
|
autoSelectNext: true,
|
||||||
@ -26,6 +30,7 @@ export default class Search extends Extension {
|
|||||||
toggleSearch() {
|
toggleSearch() {
|
||||||
return () => {
|
return () => {
|
||||||
this.options.searching = !this.options.searching
|
this.options.searching = !this.options.searching
|
||||||
|
this.editor.emit('toggleSearch', this.options.searching)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user