mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-02-10 15:42:54 +08:00
commit
9914752788
@ -6,7 +6,8 @@ window.APP = {
|
|||||||
style: CONFIG.style,
|
style: CONFIG.style,
|
||||||
showInput: false,
|
showInput: false,
|
||||||
showWindow: false,
|
showWindow: false,
|
||||||
suggestions: [],
|
backingSuggestions: [],
|
||||||
|
removedSuggestions: [],
|
||||||
templates: CONFIG.templates,
|
templates: CONFIG.templates,
|
||||||
message: '',
|
message: '',
|
||||||
messages: [],
|
messages: [],
|
||||||
@ -41,6 +42,11 @@ window.APP = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
suggestions() {
|
||||||
|
return this.backingSuggestions.filter((el) => this.removedSuggestions.indexOf(el.name) <= -1);
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
ON_OPEN() {
|
ON_OPEN() {
|
||||||
this.showInput = true;
|
this.showInput = true;
|
||||||
@ -68,13 +74,15 @@ window.APP = {
|
|||||||
if (!suggestion.params) {
|
if (!suggestion.params) {
|
||||||
suggestion.params = []; //TODO Move somewhere else
|
suggestion.params = []; //TODO Move somewhere else
|
||||||
}
|
}
|
||||||
if (this.suggestions.find(a => a.name == suggestion.name)) {
|
if (this.backingSuggestions.find(a => a.name == suggestion.name)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.suggestions.push(suggestion);
|
this.backingSuggestions.push(suggestion);
|
||||||
},
|
},
|
||||||
ON_SUGGESTION_REMOVE({ name }) {
|
ON_SUGGESTION_REMOVE({ name }) {
|
||||||
this.suggestions = this.suggestions.filter((sug) => sug.name !== name)
|
if(this.removedSuggestions.indexOf(name) <= -1) {
|
||||||
|
this.removedSuggestions.push(name);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ON_TEMPLATE_ADD({ template }) {
|
ON_TEMPLATE_ADD({ template }) {
|
||||||
if (this.templates[template.id]) {
|
if (this.templates[template.id]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user