Started implementing soft delete attacks, added delete toast

This commit is contained in:
Thaum
2015-03-24 13:07:27 +00:00
parent 107a4150ff
commit 46b836e707
6 changed files with 39 additions and 6 deletions

View File

@@ -3,7 +3,8 @@ var damageTypes = ["bludgeoning", "piercing", "slashing", "acid", "cold", "fire"
Template.attackEdit.events({
"tap #deleteAttack": function(event, instance){
Attacks.remove(this._id);
Attacks.softRemove(this._id);
GlobalUI.deletedToast(this._id, "Attacks", "Attack");
},
"change #attackBonusInput": function(event){
var value = event.currentTarget.value;

View File

@@ -33,6 +33,7 @@
<link rel="import" href="/components/paper-slider-diff/paper-slider.html">
<link rel="import" href="/components/paper-spinner/paper-spinner.html">
<link rel="import" href="/components/paper-tabs/paper-tabs.html">
<link rel="import" href="/components/paper-toast/paper-toast.html">
<link rel="import" href="/components/paper-toggle-button/paper-toggle-button.html">
<!--custom components-->

View File

@@ -78,7 +78,9 @@
{{/if}}
</paper-action-dialog>
<paper-toast global-toast></paper-toast>
<core-overlay></core-overlay>
<core-overlay-layer></core-overlay-layer>
<paper-toast global-toast>
{{#if session globalToastTemplate}}
{{> UI.dynamic template=globalToastTemplate data=globalToastData}}
{{/if}}
</paper-toast>
</template>

View File

@@ -0,0 +1,3 @@
<template name="undoToast">
<div id="undoButton" style="color: #eeff41;">Undo</div>
</template>

View File

@@ -0,0 +1,7 @@
Template.undoToast.events({
'tap #undoButton': function(event, instance){
var collection = window[this.collection];
if(!collection) return;
collection.restore(this.id);
}
});