This commit is contained in:
Mo Bitar
2016-12-28 15:22:53 -06:00
parent 195d219e88
commit 96006e3dca
11 changed files with 48 additions and 28 deletions

View File

@@ -3,19 +3,19 @@ class ModelManager extends ItemManager {
constructor() {
super();
this.notes = [];
this.groups = [];
this.tags = [];
this.dirtyItems = [];
}
resolveReferences() {
super.resolveReferences()
this.notes = this.itemsForContentType("Note");
this.notes.push.apply(this.notes, _.difference(this.itemsForContentType("Note"), this.notes));
this.notes.forEach(function(note){
note.updateReferencesLocalMapping();
})
this.tags = this.itemsForContentType("Tag");
this.tags.push.apply(this.tags, _.difference(this.itemsForContentType("Tag"), this.tags));
this.tags.forEach(function(tag){
tag.updateReferencesLocalMapping();
})
@@ -48,6 +48,7 @@ class ModelManager extends ItemManager {
addTag(tag) {
this.tags.unshift(tag);
this.addItem(tag);
console.log("adding tag", tag, "tags", this.tags);
}
addTagToNote(tag, note) {