parent
71f81f1c5e
commit
85d9d875a1
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "szuru-chrome",
|
"name": "szuru-chrome",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Import media from various sites into szurubooru.",
|
"description": "Import media from various sites into szurubooru.",
|
||||||
"author": "neobooru",
|
"author": "neobooru",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@
|
||||||
<div class="autocomplete-items" v-bind:class="{ show: autocompleteShown }">
|
<div class="autocomplete-items" v-bind:class="{ show: autocompleteShown }">
|
||||||
<div
|
<div
|
||||||
v-for="(tag, idx) in autocompleteTags"
|
v-for="(tag, idx) in autocompleteTags"
|
||||||
|
@click="onClickAutocompleteTagItem(tag)"
|
||||||
:key="tag.name"
|
:key="tag.name"
|
||||||
:class="{
|
:class="{
|
||||||
active: idx == autocompleteIndex,
|
active: idx == autocompleteIndex,
|
||||||
|
|
@ -324,6 +325,9 @@ export default Vue.extend({
|
||||||
// Only add tag if it doesn't already exist
|
// Only add tag if it doesn't already exist
|
||||||
if (tag.name.length > 0 && this.selectedPost.tags.find((x) => x.name == tag.name) == undefined) {
|
if (tag.name.length > 0 && this.selectedPost.tags.find((x) => x.name == tag.name) == undefined) {
|
||||||
this.selectedPost.tags.push(tag);
|
this.selectedPost.tags.push(tag);
|
||||||
|
|
||||||
|
// Add implications for the tag
|
||||||
|
this.selectedPost.tags.push(...tag.implications);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -416,12 +420,14 @@ export default Vue.extend({
|
||||||
const tagToAdd = this.autocompleteTags[this.autocompleteIndex];
|
const tagToAdd = this.autocompleteTags[this.autocompleteIndex];
|
||||||
this.addTag(tagToAdd);
|
this.addTag(tagToAdd);
|
||||||
this.addTagInput = ""; // Reset input
|
this.addTagInput = ""; // Reset input
|
||||||
|
|
||||||
// Add implications for the tag
|
|
||||||
tagToAdd.implications.forEach(this.addTag);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onClickAutocompleteTagItem(tag: TagViewModel) {
|
||||||
|
this.addTag(tag);
|
||||||
|
this.addTagInput = ""; // Reset input
|
||||||
|
this.autocompleteShown = false; // Hide autocomplete list
|
||||||
|
},
|
||||||
async autoCompletePopulator(input: string) {
|
async autoCompletePopulator(input: string) {
|
||||||
// Based on https://www.w3schools.com/howto/howto_js_autocomplete.asp
|
// Based on https://www.w3schools.com/howto/howto_js_autocomplete.asp
|
||||||
// TODO: Put this in a separate component
|
// TODO: Put this in a separate component
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue