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.
educoder/app/views/admins/shared/delete.js.erb

22 lines
491 B

var deleteRow = $('<%= params[:element] %>');
var refreshUrl = '<%= params[:refresh_url] %>';
$.notify({ message: '操作成功' },{ type: 'success' });
var refreshFunc = function(url) {
$.ajax({
url: url.length > 0 ? url : window.location.href,
method: 'GET',
dataType: "script"
})
}
if(deleteRow.length > 0){
var needRefresh = deleteRow.siblings().length == 0;
deleteRow.remove();
if(needRefresh){ refreshFunc(refreshUrl); }
} else {
refreshFunc(refreshUrl);
}