exsit_exhibit.js
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
jQuery(function(){
jQuery('#dialog6').dialog({
autoOpen: false,
width:610,
height:360,
modal: true,
resizable: true
});
});
function uploadPic(id, upload_limit){
if(upload_limit == 0)
{
alert('您上传的照片已经是最大数量');
return false;
}
jQuery('#exhibit_id').val(id);
jQuery('#dialog6').dialog('open');
updateFile(upload_limit);
return false;
}
var alertStatus = true;
function delete_photo(id){
if(confirm('您确定要删除该图片?')){
jQuery('#photo_list_li_'+id).remove();
jQuery('#photo_str_'+id).remove();
}
}
window.onbeforeunload = function(){
var comment = $("#comment").val();
if(alertStatus && comment != '' && typeof comment != 'undefined'){
return "你确定要离开该页面,您的数据未被提交?";
}
}
function changeStatus()
{
alertStatus = false;
}
//删除晒物图片
function depreciate(id, exhibit_id, obj)
{
$.ajax({
type: "get",
url: '/home/exhibit/deleteexhibitimge',
data: "id=" + id + '&exhibit_id=' + exhibit_id,
dataType:'json',
success: function(jsonData)
{
if(jsonData.code == 200){
jQuery(obj).animate({opacity: "hide" }, "slow");
jQuery('#depreciate_' + id).animate({opacity: "hide" }, "slow");
return false;
}
alert(jsonData.message);
return false;
}
});
}