Prettified all remaining detail boxes to be view -> edit
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
<template name="spellDialog">
|
||||
{{#with spell}}
|
||||
{{#baseDialog title=name class=colorClass showEdit=true editing=editing}}
|
||||
{{#if editing}}
|
||||
{{> spellEdit}}
|
||||
{{else}}
|
||||
{{> spellDetails}}
|
||||
{{/if}}
|
||||
{{#baseDialog title=name class=colorClass startEditing=../startEditing}}
|
||||
{{> spellDetails}}
|
||||
{{else}}
|
||||
{{> spellEdit}}
|
||||
{{/baseDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
|
||||
@@ -11,30 +11,16 @@ var spellLevels = [
|
||||
{ name: "Level 9", level: 9 },
|
||||
];
|
||||
|
||||
|
||||
Template.spellDialog.onCreated(function(){
|
||||
this.editing = new ReactiveVar(false);
|
||||
});
|
||||
|
||||
Template.spellDialog.helpers({
|
||||
spell: function(){
|
||||
return Spells.findOne(this.spellId);
|
||||
},
|
||||
editing: function(){
|
||||
return Template.instance().editing.get();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
Template.spellDialog.events({
|
||||
"color-change": function(event, instance){
|
||||
Spells.update(instance.data.spellId, {$set: {color: event.color}});
|
||||
},
|
||||
"tap #editButton": function(event, instance){
|
||||
instance.editing.set(true);
|
||||
},
|
||||
"tap #doneEditingButton": function(event, instance){
|
||||
instance.editing.set(false);
|
||||
},
|
||||
"tap #deleteButton": function(event, instance){
|
||||
Spells.softRemoveNode(instance.data.spellId);
|
||||
GlobalUI.deletedToast(instance.data.spellId, "Spells", "Spell");
|
||||
|
||||
Reference in New Issue
Block a user