currentCategory(newCategory) {
this.updateURL();
},
+ tagFilter(newFilter) {
+ this.updateURL();
+ },
+ sortMethod(newSort) {
+ this.updateURL();
+ },
+ reverseTags(newReverse) {
+ this.updateURL();
+ },
},
async created() {
await this.getFamilyData()
mounted() {
const urlParams = new URLSearchParams(window.location.search);
const category = urlParams.get('category');
+ const filter = urlParams.get('filter');
+ const sort_ = urlParams.get('sort');
+ const reverse = urlParams.get('reverse');
if (category) {
this.currentCategory = category;
}
const commit = urlParams.get('commit');
+ if (filter) {
+ this.tagFilter = filter;
+ }
+ if (sort_) {
+ this.sortMethod = sort_;
+ }
+ if (reverse === "true") {
+ this.reverseTags = true;
+ } else {
+ this.reverseTags = false;
+ }
if (commit) {
this.commit = commit;
this.loadCSV();
} else {
url.searchParams.delete('category');
}
+ if (this.tagFilter !== "") {
+ url.searchParams.set('filter', this.tagFilter);
+ } else {
+ url.searchParams.delete('filter');
+ }
+ if (this.sortMethod !== "") {
+ url.searchParams.set('sort', this.sortMethod);
+ } else {
+ url.searchParams.delete('sort');
+ }
+ if (this.reverseTags !== "") {
+ url.searchParams.set('reverse', this.reverseTags);
+ } else {
+ url.searchParams.delete('reverse');
+ }
history.pushState(null, '', url);
},
familyPangram(family) {