|
|
@ -125,12 +125,7 @@ export class FileEditComponent implements OnInit, OnChanges {
|
|
|
|
[tag.id], []);
|
|
|
|
[tag.id], []);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.tags.findIndex(t => t.getNormalizedOutput() === tag.getNormalizedOutput()) < 0) {
|
|
|
|
this.mapFileTagsToTagList();
|
|
|
|
this.tags.push(tag);
|
|
|
|
|
|
|
|
this.tags = this.tags.sort(
|
|
|
|
|
|
|
|
(a, b) => a.getNormalizedOutput().localeCompare(b.getNormalizedOutput()));
|
|
|
|
|
|
|
|
this.tags = [...this.tags]; // angular pls detect it wtf
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const index = this.tags.indexOf(tag);
|
|
|
|
const index = this.tags.indexOf(tag);
|
|
|
|
index >= 0 && this.tagScroll.scrollToIndex(index);
|
|
|
|
index >= 0 && this.tagScroll.scrollToIndex(index);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -142,11 +137,7 @@ export class FileEditComponent implements OnInit, OnChanges {
|
|
|
|
[], [tag.id]);
|
|
|
|
[], [tag.id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const index = this.tags.indexOf(tag);
|
|
|
|
this.mapFileTagsToTagList();
|
|
|
|
if (index >= 0) {
|
|
|
|
|
|
|
|
this.tags.splice(index, 1);
|
|
|
|
|
|
|
|
this.tags = [...this.tags]; // so angular detects the change
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private filterSuggestionTag(tag: string) {
|
|
|
|
private filterSuggestionTag(tag: string) {
|
|
|
|