38 lines
949 B
JavaScript
38 lines
949 B
JavaScript
|
|
|
|
$('body').on('click', '.answer-msg', function(event){
|
|
event.preventDefault();
|
|
var eventid = $(this).data('id');
|
|
$('#reponse-msg').empty().html($(this).data('id'));
|
|
jQuery.post(
|
|
ajaxurl,
|
|
{
|
|
'action': 'getReponseForMsg',
|
|
'id' : eventid,
|
|
},
|
|
function(response){
|
|
$('#reponse-msg').empty().html(response);
|
|
$.fancybox.open({
|
|
src : '#reponse-msg',
|
|
type : 'inline',
|
|
});
|
|
}
|
|
);
|
|
});
|
|
|
|
$('body').on('click', '.send-answer', function(e){
|
|
e.preventDefault();
|
|
var email = $('#emailTosend').val();
|
|
var message = $('#msgTosend').val();
|
|
jQuery.post(
|
|
ajaxurl,
|
|
{
|
|
'action': 'sendReponse',
|
|
'email' : email,
|
|
'message' : message,
|
|
},
|
|
function(response){
|
|
$('#reponse-msg').empty().html(response);
|
|
}
|
|
);
|
|
})
|