You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.6 KiB
36 lines
1.6 KiB
$(document).ready(function() {
|
|
$('a.doc.delete-link').on('click', function(e){
|
|
e.preventDefault();
|
|
var link = $(this).attr('href');
|
|
var dlg_msg = $('#dialog-message');
|
|
var docname = $($(this).closest('.doc-panel')[0]).data('docname');
|
|
var redirect_url = $($(this).closest('.doc-panel')[0]).data('redirect');
|
|
|
|
dlg_msg.dialog({
|
|
title: 'Удалить документ?',
|
|
buttons:{'Да': function(){
|
|
$.post(link, function(data){
|
|
$('#doc_row_' + data['del_id']).remove();
|
|
dlg_msg.html(data['msg']);
|
|
dlg_msg.dialog({title: data['title'],
|
|
buttons: {
|
|
'Ok': function(e){
|
|
dlg_msg.dialog('close');
|
|
if (redirect_url) {
|
|
location.replace(redirect_url);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
dlg_msg.dialog('open');
|
|
});
|
|
},
|
|
'Нет': function(){
|
|
dlg_msg.dialog('close');
|
|
}
|
|
}
|
|
}).html('Нажмите "Да", чтобы удалить документ:<br/>' + docname);
|
|
dlg_msg.dialog('open');
|
|
//dlg_msg.dialog({title: data.message['title']}).html(data.message['msg']);
|
|
});
|
|
});
|
|
|