refactor: post editor
This commit is contained in:
parent
3d06421acb
commit
78725d1e88
31 changed files with 1603 additions and 766 deletions
23
src/services/post-editor.service.ts
Normal file
23
src/services/post-editor.service.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class PostEditorService extends EventTarget {
|
||||
static instance: PostEditorService
|
||||
|
||||
isSuggestionPopupOpen = false
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
if (!PostEditorService.instance) {
|
||||
PostEditorService.instance = this
|
||||
}
|
||||
return PostEditorService.instance
|
||||
}
|
||||
|
||||
closeSuggestionPopup() {
|
||||
if (this.isSuggestionPopupOpen) {
|
||||
this.isSuggestionPopupOpen = false
|
||||
this.dispatchEvent(new CustomEvent('closeSuggestionPopup'))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const instance = new PostEditorService()
|
||||
export default instance
|
||||
Loading…
Add table
Add a link
Reference in a new issue