From 2fac76f7026c0e908028f16995cd5621afb41ad3 Mon Sep 17 00:00:00 2001 From: Thaum Date: Tue, 7 Apr 2015 11:40:54 +0000 Subject: [PATCH] Replaced restore with restoreNode for undo button --- .../client/views/paperTemplates/undoToast/undoToast.js | 2 +- rpg-docs/lib/functions/parenting.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rpg-docs/client/views/paperTemplates/undoToast/undoToast.js b/rpg-docs/client/views/paperTemplates/undoToast/undoToast.js index ac3d033d..25ff9b30 100644 --- a/rpg-docs/client/views/paperTemplates/undoToast/undoToast.js +++ b/rpg-docs/client/views/paperTemplates/undoToast/undoToast.js @@ -5,6 +5,6 @@ Template.undoToast.events({ console.warn("Collection with name ", this.collection, " could not be found"); return; } - collection.restore(this.id); + collection.restoreNode(this.id); } }); diff --git a/rpg-docs/lib/functions/parenting.js b/rpg-docs/lib/functions/parenting.js index 57d9ea5a..9b472c20 100644 --- a/rpg-docs/lib/functions/parenting.js +++ b/rpg-docs/lib/functions/parenting.js @@ -73,6 +73,14 @@ makeChild = function(collection, inheritedKeys){ } }); + collection.softRemoveNode = collection.softRemoveNode || function(id){ + collection.softRemove(id); + }; + + collection.restoreNode = collection.restoreNode || function(id){ + collection.restore(id); + }; + collection.attachSchema(childSchema); childCollections.push(collection);