I'm using this modal window of material design which when you click on the close button closes, this same function of that button I want you to do it in the send button when you click and close after sending the data that is shown to me in the modal window.
Here is my js
$('body').on('click', '.publisher_timeline_js', function(event)
{
var _this = $(this);
var publisher = _this.parents('.timeline');
/* get handle */
var handle = publisher.attr('data-handle');
/* get text */
var textarea = publisher.find('textarea');
var attachments = publisher.find('.publisher-time-attach');
var photos = publisher.data('uploading');
var link = publisher.data('scrabing');
$.post(api['/stream/store'], {'handle': handle, 'message': textarea.val(), 'photos': JSON.stringify(photos), 'datas': JSON.stringify(link)}, function(response) {
//console.log(JSON.stringify(link));
if (response.callback) {
eval(response.callback);
} else {
textarea.val('');
publisher.removeData('uploading');
$('.publisher-timeline').html('').fadeOut();
$('.file_up_drop').show();
publisher.removeData('scrabing');
attachments.hide();
attachments.find('li.item').remove();
//AQUI ES DONDE QUIERO QUE CIERRE LA VENTANA MODAL
if (response.message.type == 'photo') {
} else if (response.message.type == 'link') {
} else if (response.message.type == 'video') {
} else if (response.message.type == 'rich') {
} else if (response.message.type == 'text') {
}
//$('.timeline-publisher').prepend(template);
}
}, 'json');
});