I am using this script: https://github.com/goranefbl/jquery.tiny.modal/blob/master/jquery.tinymodal.js
in one of my functions that is fired on button press, this one:
function fireLightbox(quarter,room_id,otherRoom) {
$.tinyModal({
title: "Room is free, want to book now?",
html: '#bookRoom',
buttons: ["Book"],
Book: bookTheRoom(quarter) // <- the issue
});
}
"Book" button that appears inside lightbox above should execute this below function, but its firing immediately when above function loads.
function bookTheRoom(quarter) {
console.log(quarter);
}
I need it ofc. executed once I click on button, not once the first "fireLightbox" function is executed.
Also tried like this, it does not execute it, but also doesn't pass the variable, altho this makes sense to me that its not working
function fireLightbox(quarter,room_id,otherRoom) {
$.tinyModal({
title: "Room is free, want to book now?",
html: '#bookRoom',
buttons: ["Book"],
Book: function(quarter) {
console.log(quarter);
bookTheRoom(quarter);
}
});
}
Of course function works fine if I call it without () but then I don't have parameters.