From 6f2c8f1970c2bd9f543ad0ec72b30544df0ef1db Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Fri, 10 Nov 2017 11:16:09 -0600 Subject: [PATCH] Fixes --- app/assets/javascripts/app/frontend/controllers/editor.js | 4 ---- app/assets/javascripts/app/services/componentManager.js | 8 ++++---- app/assets/javascripts/app/services/migrationManager.js | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/app/frontend/controllers/editor.js b/app/assets/javascripts/app/frontend/controllers/editor.js index d560a0abf..054b067ec 100644 --- a/app/assets/javascripts/app/frontend/controllers/editor.js +++ b/app/assets/javascripts/app/frontend/controllers/editor.js @@ -28,10 +28,6 @@ angular.module('app.frontend') this.componentManager = componentManager; this.componentStack = []; - $rootScope.$on("theme-changed", function(){ - this.postThemeToExternalEditor(); - }.bind(this)) - $rootScope.$on("sync:taking-too-long", function(){ this.syncTakingTooLong = true; }.bind(this)); diff --git a/app/assets/javascripts/app/services/componentManager.js b/app/assets/javascripts/app/services/componentManager.js index da97f6231..4ce4bdc7b 100644 --- a/app/assets/javascripts/app/services/componentManager.js +++ b/app/assets/javascripts/app/services/componentManager.js @@ -1,7 +1,7 @@ -class ComponentManager { +/* This domain will be used to save context item client data */ +let ClientDataDomain = "org.standardnotes.sn.components"; - /* This domain will be used to save context item client data */ - let ClientDataDomain = "org.standardnotes.sn.components"; +class ComponentManager { constructor($rootScope, modelManager, syncManager, themeManager, $timeout, $compile) { this.$compile = $compile; @@ -121,7 +121,7 @@ class ComponentManager { jsonForItem(item, component) { var params = {uuid: item.uuid, content_type: item.content_type, created_at: item.created_at, updated_at: item.updated_at, deleted: item.deleted}; params.content = item.createContentJSONFromProperties(); - params.clientData = item.getDomainDataItem(component.url, ClientDataDomain); + params.clientData = item.getDomainDataItem(component.url, ClientDataDomain) || {}; this.removePrivatePropertiesFromResponseItems([params]); return params; } diff --git a/app/assets/javascripts/app/services/migrationManager.js b/app/assets/javascripts/app/services/migrationManager.js index b7f252727..527c692bf 100644 --- a/app/assets/javascripts/app/services/migrationManager.js +++ b/app/assets/javascripts/app/services/migrationManager.js @@ -48,7 +48,7 @@ class MigrationManager { } for(let editor of editors) { - editor.setItemToBeDeleted(); + this.modelManager.setItemToBeDeleted(editor); } this.syncManager.sync();