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
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');
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue