Fixed some editing bugs on new buffs, improved style

This commit is contained in:
Stefan Zermatten
2017-09-07 14:33:59 +02:00
parent e2933c2df5
commit b43ee08d75
8 changed files with 45 additions and 23 deletions

View File

@@ -14,7 +14,7 @@ Template.customBuffEditList.events({
this.enabled = true;
}
const customBuffId = CustomBuffs.insert({
name: "New Buff",
name: this.name || "New Buff",
charId: this.charId,
parent: {
id: this.parentId,
@@ -23,7 +23,7 @@ Template.customBuffEditList.events({
});
pushDialogStack({
template: "customBuffEdit",
data: {id: customBuffId},
data: {customBuffId},
element: event.currentTarget,
returnElement: () => instance.find(`tr.buff[data-id='${customBuffId}']`),
});
@@ -34,8 +34,8 @@ Template.customBuffEditListItem.events({
"tap .edit-buff": function(event, template){
pushDialogStack({
template: "customBuffEdit",
data: {buff: this.buff},
data: {customBuffId: this.buff._id},
element: event.currentTarget.parentElement.parentElement,
});
},
});
});