Added Soft remove and a character asset parenting system

This commit is contained in:
Thaum
2015-03-18 08:59:02 +00:00
parent 06b0ad7eba
commit 3656a0b66f
24 changed files with 215 additions and 121 deletions

View File

@@ -30,14 +30,7 @@ Containers.helpers({
}
});
Containers.before.remove(function (userId, container) {
if(Meteor.isServer){
Items.remove({container: container._id});
} else {
Items.find({container: container._id}).forEach(function(item){
Items.remove(item._id);
});
}
});
Containers.attachBehaviour('softRemovable');
makeParent(Containers); //parents of items
Containers.allow(CHARACTER_SUBSCHEMA_ALLOW);