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