From: Marc Foley Date: Fri, 11 Jul 2025 12:46:58 +0000 (+0100) Subject: rm tag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=959f1c6196c9a0b3d90cac941a57a783e5e71f24;p=thirdparty%2Fgoogle%2Ffonts.git rm tag --- diff --git a/tagger2/TagsByFont.js b/tagger2/TagsByFont.js index 67700ee43..179a39126 100644 --- a/tagger2/TagsByFont.js +++ b/tagger2/TagsByFont.js @@ -6,6 +6,11 @@ export default { return this.tags.filter(tag => tag.family && tag.family.name === this.font); } }, + methods: { + removeTag(tag) { + this.$root.$emit('remove-tag', tag); + } + }, template: `

Tags for fonter

@@ -16,7 +21,9 @@ export default {
diff --git a/tagger2/index.html b/tagger2/index.html index a93bb88da..b662b2ebc 100644 --- a/tagger2/index.html +++ b/tagger2/index.html @@ -21,10 +21,12 @@ import TagsByFont from "./TagsByFont.js"; import TagsByCategories from "./TagsByCategories.js"; import Panel from "./Panel.js"; + import TagView from "./TagView.js"; Vue.component('tags-by-font', TagsByFont); Vue.component('tags-by-categories', TagsByCategories); Vue.component('panel', Panel); + Vue.component('tag-view', TagView); var app = new Vue({ el: '#app', @@ -45,6 +47,13 @@ }, removePanel(idx) { this.panels.splice(idx, 1); + }, + removeTag(tag) { + console.log("Removing tag:", tag); + const index = this.tags.items.indexOf(tag) + if (index !== -1) { + this.tags.items.splice(index, 1); + } } }, async created() { @@ -54,6 +63,7 @@ this.gf.loadFamilies(); this.tags = new Tags(this.gf); this.tags.items = this.tags.items; + this.$root.$on("remove-tag", this.removeTag); } }); window.app = app