locally clear refs before processing
This commit is contained in:
@@ -29,6 +29,7 @@ angular.module('app.frontend')
|
|||||||
modelManager.createRelationshipBetweenItems(note, tag);
|
modelManager.createRelationshipBetweenItems(note, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
note.setDirty(true);
|
||||||
syncManager.sync();
|
syncManager.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ class Item {
|
|||||||
this.setDirty(true);
|
this.setDirty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
locallyClearAllReferences() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
mergeMetadataFromItem(item) {
|
mergeMetadataFromItem(item) {
|
||||||
_.merge(this, _.omit(item, ["content"]));
|
_.merge(this, _.omit(item, ["content"]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,14 @@ class Note extends Item {
|
|||||||
this.tags = [];
|
this.tags = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
locallyClearAllReferences() {
|
||||||
|
super.locallyClearAllReferences();
|
||||||
|
this.tags.forEach(function(tag){
|
||||||
|
_.pull(tag.notes, this);
|
||||||
|
}.bind(this))
|
||||||
|
this.tags = [];
|
||||||
|
}
|
||||||
|
|
||||||
isBeingRemovedLocally() {
|
isBeingRemovedLocally() {
|
||||||
this.tags.forEach(function(tag){
|
this.tags.forEach(function(tag){
|
||||||
_.pull(tag.notes, this);
|
_.pull(tag.notes, this);
|
||||||
|
|||||||
@@ -55,6 +55,15 @@ class Tag extends Item {
|
|||||||
this.notes = [];
|
this.notes = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
locallyClearAllReferences() {
|
||||||
|
super.locallyClearAllReferences();
|
||||||
|
this.notes.forEach(function(note){
|
||||||
|
_.pull(note.tags, this);
|
||||||
|
}.bind(this))
|
||||||
|
|
||||||
|
this.notes = [];
|
||||||
|
}
|
||||||
|
|
||||||
isBeingRemovedLocally() {
|
isBeingRemovedLocally() {
|
||||||
this.notes.forEach(function(note){
|
this.notes.forEach(function(note){
|
||||||
_.pull(note.tags, this);
|
_.pull(note.tags, this);
|
||||||
|
|||||||
@@ -60,11 +60,13 @@ class SNCrypto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
base64(text) {
|
base64(text) {
|
||||||
return CryptoJS.enc.Utf8.parse(text).toString(CryptoJS.enc.Base64)
|
// return CryptoJS.enc.Utf8.parse(text).toString(CryptoJS.enc.Base64)
|
||||||
|
return window.btoa(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
base64Decode(base64String) {
|
base64Decode(base64String) {
|
||||||
return CryptoJS.enc.Base64.parse(base64String).toString(CryptoJS.enc.Utf8)
|
// return CryptoJS.enc.Base64.parse(base64String).toString(CryptoJS.enc.Utf8)
|
||||||
|
return window.atob(base64String);
|
||||||
}
|
}
|
||||||
|
|
||||||
sha256(text) {
|
sha256(text) {
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ class ModelManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resolveReferencesForItem(item) {
|
resolveReferencesForItem(item) {
|
||||||
|
item.locallyClearAllReferences();
|
||||||
var contentObject = item.contentObject;
|
var contentObject = item.contentObject;
|
||||||
if(!contentObject.references) {
|
if(!contentObject.references) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.one-line-overflow {
|
.one-line-overflow {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
.panel.panel-default.account-panel.panel-right
|
.panel.panel-default.account-panel.panel-right
|
||||||
.panel-body
|
.panel-body
|
||||||
%div{"style" => "font-size: 18px;", "ng-if" => "!extensionManager.extensions.length"} No extensions installed
|
%div{"style" => "font-size: 15px;", "ng-if" => "!extensionManager.extensions.length"} No extensions installed
|
||||||
%div{"ng-if" => "extensionManager.extensions.length"}
|
%div{"ng-if" => "extensionManager.extensions.length"}
|
||||||
%section.gray-bg.inline-h.mb-10.medium-padding{"ng-repeat" => "extension in extensionManager.extensions", "ng-init" => "extension.formData = {}"}
|
%section.gray-bg.inline-h.mb-10.medium-padding{"ng-repeat" => "extension in extensionManager.extensions | orderBy: 'name'", "ng-init" => "extension.formData = {}"}
|
||||||
%h3.center-align {{extension.name}}
|
%h3.center-align {{extension.name}}
|
||||||
.center-align.centered.mt-10
|
.center-align.centered.mt-10
|
||||||
%label.block.normal Send data:
|
%label.block.normal Send data:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"select-on-click" => "true"}
|
"select-on-click" => "true"}
|
||||||
.save-status{"ng-class" => "{'red bold': ctrl.saveError}", "ng-bind-html" => "ctrl.noteStatus"}
|
.save-status{"ng-class" => "{'red bold': ctrl.saveError}", "ng-bind-html" => "ctrl.noteStatus"}
|
||||||
.tags
|
.tags
|
||||||
%input.tags-input{"type" => "text", "ng-keyup" => "$event.keyCode == 13 && ctrl.updateTagsFromTagsString($event, ctrl.tagsString)",
|
%input.tags-input{"type" => "text", "ng-keyup" => "$event.keyCode == 13 && $event.target.blur();",
|
||||||
"ng-model" => "ctrl.tagsString", "placeholder" => "#tags", "ng-blur" => "ctrl.updateTagsFromTagsString($event, ctrl.tagsString)"}
|
"ng-model" => "ctrl.tagsString", "placeholder" => "#tags", "ng-blur" => "ctrl.updateTagsFromTagsString($event, ctrl.tagsString)"}
|
||||||
.section-menu
|
.section-menu
|
||||||
%ul.nav
|
%ul.nav
|
||||||
|
|||||||
Reference in New Issue
Block a user