mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Added a delete confirmation modal to all views.
This commit is contained in:
parent
4d9d2acff6
commit
29ddc544e5
27 changed files with 117 additions and 127 deletions
18
client/General/DeleteConfModal/deleteConfirmationModal.html
Normal file
18
client/General/DeleteConfModal/deleteConfirmationModal.html
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<template name="deleteConfirmationModal">
|
||||
<div id="modalDelete" class="modal">
|
||||
<div class="modal-content">
|
||||
<h4>Delete Confirmation</h4>
|
||||
You are about to permanently delete {{itemName}} from the {{viewName}} list. Are you sure?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="modal-close waves-effect waves-light btn left cancelDelete orange">Cancel</a>
|
||||
</div>
|
||||
<div class="col s6 m6 l6">
|
||||
<a class="waves-effect waves-light btn confirmDelete red right">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
33
client/General/DeleteConfModal/deleteConfirmationModal.js
Normal file
33
client/General/DeleteConfModal/deleteConfirmationModal.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
Template.deleteConfirmationModal.onCreated(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.deleteConfirmationModal.onRendered(function() {
|
||||
$('.modal').modal();
|
||||
});
|
||||
|
||||
Template.deleteConfirmationModal.helpers({
|
||||
itemName: function() {
|
||||
return Session.get("item");
|
||||
},
|
||||
viewName: function() {
|
||||
return Session.get("view");
|
||||
}
|
||||
});
|
||||
|
||||
Template.deleteConfirmationModal.events({
|
||||
'click .confirmDelete' (event) {
|
||||
event.preventDefault();
|
||||
let deleteId = Session.get("deleteId");
|
||||
let method = Session.get("method");
|
||||
|
||||
Meteor.call(method, deleteId, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR deleting item from modal: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESSFULLY deleted.");
|
||||
$('#modalDelete').modal('close');
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
@ -26,11 +26,11 @@ Template.headerBar.events({
|
|||
'click .navBtn' (event) {
|
||||
event.preventDefault();
|
||||
var clickedTarget = event.target.id;
|
||||
console.log("clicked " + clickedTarget);
|
||||
// console.log("clicked " + clickedTarget);
|
||||
if (clickedTarget == 'mainMenu') {
|
||||
FlowRouter.go('/');
|
||||
} else {
|
||||
console.log("should be going to /" + clickedTarget);
|
||||
// console.log("should be going to /" + clickedTarget);
|
||||
FlowRouter.go('/' + clickedTarget);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue