Added library UI for selecting a library item

This commit is contained in:
Stefan Zermatten
2017-04-21 15:10:33 +02:00
parent 7b6c59fa6c
commit a459610c09
7 changed files with 143 additions and 1 deletions

View File

@@ -33,6 +33,21 @@ Template.itemDialog.events({
"click #doneEditingButton": function(event, instance){
instance.editing.set(false);
},
"click #libraryButton": function(event, instance){
pushDialogStack({
template: "itemLibraryDialog",
element: event.currentTarget,
callback: function(result){
if (!result) return;
delete result.parent;
delete result._id;
delete result.charId;
result.quantity = 1;
Items.update(instance.data.itemId, {$set: result});
//TODO Replace the effects with the effects of the library item
},
})
},
"color-change": function(event, instance){
Items.update(instance.data.itemId, {$set: {color: event.color}});
},