mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Little refactoring
This commit is contained in:
parent
d80e38ede8
commit
12418eefd9
@ -221,11 +221,14 @@ export default {
|
|||||||
}),
|
}),
|
||||||
new History(),
|
new History(),
|
||||||
new Mention({
|
new Mention({
|
||||||
|
// a list of all suggested items
|
||||||
items: () => {
|
items: () => {
|
||||||
this.suggestionType = this.mentionSuggestionType
|
|
||||||
return this.users
|
return this.users
|
||||||
},
|
},
|
||||||
|
// is called when a suggestion starts
|
||||||
onEnter: ({ items, query, range, command, virtualNode }) => {
|
onEnter: ({ items, query, range, command, virtualNode }) => {
|
||||||
|
this.suggestionType = this.mentionSuggestionType
|
||||||
|
|
||||||
this.query = query
|
this.query = query
|
||||||
this.filteredItems = items
|
this.filteredItems = items
|
||||||
this.suggestionRange = range
|
this.suggestionRange = range
|
||||||
@ -245,8 +248,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// is called when a suggestion is cancelled
|
// is called when a suggestion is cancelled
|
||||||
onExit: () => {
|
onExit: () => {
|
||||||
// reset all saved values
|
|
||||||
this.suggestionType = this.nullSuggestionType
|
this.suggestionType = this.nullSuggestionType
|
||||||
|
|
||||||
|
// reset all saved values
|
||||||
this.query = null
|
this.query = null
|
||||||
this.filteredItems = []
|
this.filteredItems = []
|
||||||
this.suggestionRange = null
|
this.suggestionRange = null
|
||||||
@ -288,11 +292,14 @@ export default {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
new Hashtag({
|
new Hashtag({
|
||||||
|
// a list of all suggested items
|
||||||
items: () => {
|
items: () => {
|
||||||
this.suggestionType = this.hashtagSuggestionType
|
|
||||||
return this.hashtags
|
return this.hashtags
|
||||||
},
|
},
|
||||||
|
// is called when a suggestion starts
|
||||||
onEnter: ({ items, query, range, command, virtualNode }) => {
|
onEnter: ({ items, query, range, command, virtualNode }) => {
|
||||||
|
this.suggestionType = this.hashtagSuggestionType
|
||||||
|
|
||||||
this.query = query
|
this.query = query
|
||||||
this.filteredItems = items
|
this.filteredItems = items
|
||||||
this.suggestionRange = range
|
this.suggestionRange = range
|
||||||
@ -312,8 +319,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// is called when a suggestion is cancelled
|
// is called when a suggestion is cancelled
|
||||||
onExit: () => {
|
onExit: () => {
|
||||||
// reset all saved values
|
|
||||||
this.suggestionType = this.nullSuggestionType
|
this.suggestionType = this.nullSuggestionType
|
||||||
|
|
||||||
|
// reset all saved values
|
||||||
this.query = null
|
this.query = null
|
||||||
this.filteredItems = []
|
this.filteredItems = []
|
||||||
this.suggestionRange = null
|
this.suggestionRange = null
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user