var deleteAttachment = function (pid, el) {
var _title = $(el).getParent('li').getElement('strong');
if (!confirm("你确认删除附件 %s 吗".replace("%s", _title.get('text').trim()))) {
return;
}
_title.addClass('delete');
new Request.JSON({
method : 'post',
url : '<?php echo site_url('admin/medias/operate');?>',//remove attachment
onComplete : function (result) {
if (200 == result.code) {
$(el).getParent('li').destroy();
} else {
_title.removeClass('delete');
alert('删除失败');
}
}
}).send('do=delete&from=ajax&pid=' + pid);
};