Fixes angular digest loop when note has more than 10 tags
This commit is contained in:
@@ -83,8 +83,8 @@ angular.module('app')
|
||||
|
||||
this.setTags = function(tags) {
|
||||
if(initialLoad) {
|
||||
initialLoad = false;
|
||||
this.selectTag(this.allTag);
|
||||
initialLoad = false;
|
||||
this.selectTag(this.allTag);
|
||||
} else {
|
||||
if(tags && tags.length > 0) {
|
||||
this.selectTag(tags[0]);
|
||||
|
||||
@@ -33,6 +33,8 @@ class Note extends Item {
|
||||
}
|
||||
|
||||
addItemAsRelationship(item) {
|
||||
this.savedTagsString = null;
|
||||
|
||||
if(item.content_type == "Tag") {
|
||||
if(!_.find(this.tags, item)) {
|
||||
this.tags.push(item);
|
||||
@@ -42,6 +44,8 @@ class Note extends Item {
|
||||
}
|
||||
|
||||
removeItemAsRelationship(item) {
|
||||
this.savedTagsString = null;
|
||||
|
||||
if(item.content_type == "Tag") {
|
||||
_.pull(this.tags, item);
|
||||
}
|
||||
@@ -49,6 +53,8 @@ class Note extends Item {
|
||||
}
|
||||
|
||||
removeAndDirtyAllRelationships() {
|
||||
this.savedTagsString = null;
|
||||
|
||||
this.tags.forEach(function(tag){
|
||||
_.pull(tag.notes, this);
|
||||
tag.setDirty(true);
|
||||
@@ -57,6 +63,8 @@ class Note extends Item {
|
||||
}
|
||||
|
||||
removeReferencesNotPresentIn(references) {
|
||||
this.savedTagsString = null;
|
||||
|
||||
super.removeReferencesNotPresentIn(references);
|
||||
|
||||
var uuids = references.map(function(ref){return ref.uuid});
|
||||
@@ -108,6 +116,7 @@ class Note extends Item {
|
||||
}
|
||||
|
||||
tagsString() {
|
||||
return Tag.arrayToDisplayString(this.tags);
|
||||
this.savedTagsString = Tag.arrayToDisplayString(this.tags);
|
||||
return this.savedTagsString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
%strong.medium Archived
|
||||
|
||||
.tags-string{"ng-if" => "ctrl.shouldShowTags(note)"}
|
||||
.faded {{note.tagsString()}}
|
||||
.faded {{note.savedTagsString || note.tagsString()}}
|
||||
|
||||
.name{"ng-if" => "note.title"}
|
||||
{{note.title}}
|
||||
|
||||
Reference in New Issue
Block a user