Rename removeAllRelationships -> removeAndDirtyAllRelationships to be more explicit
This commit is contained in:
@@ -117,7 +117,7 @@ class Item {
|
||||
|
||||
}
|
||||
|
||||
removeAllRelationships() {
|
||||
removeAndDirtyAllRelationships() {
|
||||
// must override
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ class Editor extends Item {
|
||||
super.removeItemAsRelationship(item);
|
||||
}
|
||||
|
||||
removeAllRelationships() {
|
||||
super.removeAllRelationships();
|
||||
removeAndDirtyAllRelationships() {
|
||||
super.removeAndDirtyAllRelationships();
|
||||
this.notes = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class Note extends Item {
|
||||
super.removeItemAsRelationship(item);
|
||||
}
|
||||
|
||||
removeAllRelationships() {
|
||||
removeAndDirtyAllRelationships() {
|
||||
this.tags.forEach(function(tag){
|
||||
_.pull(tag.notes, this);
|
||||
tag.setDirty(true);
|
||||
|
||||
@@ -46,7 +46,7 @@ class Tag extends Item {
|
||||
super.removeItemAsRelationship(item);
|
||||
}
|
||||
|
||||
removeAllRelationships() {
|
||||
removeAndDirtyAllRelationships() {
|
||||
this.notes.forEach(function(note){
|
||||
_.pull(note.tags, this);
|
||||
note.setDirty(true);
|
||||
|
||||
@@ -320,7 +320,7 @@ class ModelManager {
|
||||
if(!item.dummy) {
|
||||
item.setDirty(true);
|
||||
}
|
||||
item.removeAllRelationships();
|
||||
item.removeAndDirtyAllRelationships();
|
||||
}
|
||||
|
||||
/* Used when changing encryption key */
|
||||
@@ -363,14 +363,6 @@ class ModelManager {
|
||||
itemOne.setDirty(true);
|
||||
itemTwo.setDirty(true);
|
||||
}
|
||||
|
||||
removeRelationshipBetweenItems(itemOne, itemTwo) {
|
||||
itemOne.removeItemAsRelationship(itemTwo);
|
||||
itemTwo.removeItemAsRelationship(itemOne);
|
||||
|
||||
itemOne.setDirty(true);
|
||||
itemTwo.setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
angular.module('app.frontend').service('modelManager', ModelManager);
|
||||
|
||||
Reference in New Issue
Block a user