Added a delete confirmation modal to all views.

This commit is contained in:
Brian McGonagill 2022-08-26 11:18:18 -05:00
parent 4d9d2acff6
commit 29ddc544e5
27 changed files with 117 additions and 127 deletions

View file

@ -1,16 +1,11 @@
<template name="locMgmtForm">
<form action="" id="locInputForm">
<div class="row">
<div class="col s12 m6 l6 input-field">
<div class="col s8 m10 l10 input-field">
<input type="text" class="locNameInp" id="locNameInp" style="{{#if $eq locNameErr true}}border: 2px solid red;{{/if}}" />
<label for="locNameInp">Name*</label>
</div>
</div>
<div class="row">
<div class="col s6 m6 l6">
<a class="waves-effect waves-light btn cancelLocMgmt orange">Cancel</a>
</div>
<div class="col s6 m6 l6">
<div class="col s4 m2 l2 input-field">
{{#if $eq locEditMode false}}
<a class="waves-effect waves-light btn saveLocMgmt green right">Add</a>
{{else}}

View file

@ -12,4 +12,5 @@
</ul>
</div>
</div>
{{> deleteConfirmationModal}}
</template>

View file

@ -19,13 +19,11 @@ Template.locMgmtTbl.helpers({
Template.locMgmtTbl.events({
'click .deleteLocation' (event) {
event.preventDefault();
Meteor.call('delete.location', this._id, function(err, result) {
if (err) {
console.log(" ERROR deleting location: " + err);
} else {
console.log(" SUCCESS deleting the location.");
}
});
Session.set("deleteId", this._id);
Session.set("method", "delete.location");
Session.set("item", this.locationName);
Session.set("view", "Locations");
$('#modalDelete').modal('open');
},
'click .editLocation' (event) {
event.preventDefault();