mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
41 lines
1 KiB
JavaScript
41 lines
1 KiB
JavaScript
|
|
|
|
Template.myModal.onCreated(function() {
|
|
|
|
});
|
|
|
|
Template.myModal.onRendered(function() {
|
|
$('.modal').modal();
|
|
});
|
|
|
|
Template.myModal.helpers({
|
|
modalHeader: function() {
|
|
return Session.get("confirmationDialogTitle");
|
|
},
|
|
modalBody: function() {
|
|
return Session.get("confirmationDialogContent");
|
|
}
|
|
});
|
|
|
|
Template.myModal.events({
|
|
'click #continue' (event) {
|
|
event.preventDefault();
|
|
|
|
let callFunction = Session.get("eventConfirmCallBackFunction");
|
|
let functionPassId = Session.get("eventConfirmNecessaryId"); // <-- this can be an actual ID, an object, a function, whatever...
|
|
|
|
if (functionPassId == "disallowCom") {
|
|
$("#genModal").modal('close');
|
|
return;
|
|
} else {
|
|
$("#genModal").modal('close');
|
|
|
|
window[callFunction](functionPassId); // <-- calls the function and passed the Id on confirm.
|
|
}
|
|
},
|
|
'click #cancel' (event) {
|
|
event.preventDefault();
|
|
|
|
$("#genModal").modal('close');
|
|
},
|
|
});
|