add toggleSearch event

This commit is contained in:
Chrissi2812 2019-05-28 13:52:40 +02:00
parent 331ba1c36b
commit f19b5c8f34
No known key found for this signature in database
GPG Key ID: B4B82C7E618271DA

View File

@ -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
}
}