Added dialog to choose temporary hitpoints
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<!-- data just needs charId -->
|
||||
<template name="addTHPDialog">
|
||||
<div style="width: 200px; height: 100px;">
|
||||
<paper-input-decorator label="Quantity" floatinglabel>
|
||||
<input autoFocus id="quantityInput" type="number" value="10">
|
||||
</paper-input-decorator>
|
||||
<div layout horizontal justify-center>
|
||||
Delete when zero <paper-checkbox id="deleteWhenZeroCheckbox" checked style="margin-left: 8px;"></paper-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<paper-button id="cancelButton" affirmative> Cancel </paper-button>
|
||||
<paper-button id="addButton" affirmative> Add </paper-button>
|
||||
</template>
|
||||
@@ -0,0 +1,15 @@
|
||||
Template.addTHPDialog.events({
|
||||
'tap #addButton': function(event, instance){
|
||||
console.log({
|
||||
charId: this.charId,
|
||||
maximum: +instance.find('#quantityInput').value,
|
||||
deleteOnZero: !!instance.find('#deleteWhenZeroCheckbox').checked
|
||||
});
|
||||
TemporaryHitPoints.insert({
|
||||
charId: this.charId,
|
||||
maximum: +instance.find('#quantityInput').value,
|
||||
deleteOnZero: !!instance.find('#deleteWhenZeroCheckbox').checked
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user