exsit_exhibit.js 1.35 KB
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;
        }
	});
}