1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 19:29:56 +00:00

if close query zip window then stop zip process

This commit is contained in:
ilearnit
2018-03-21 18:16:02 +08:00
parent 9b16ba0e8f
commit d29ab8a9ac
3 changed files with 52 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ define([
case 'download_dir_zip_url': return fileServerRoot + 'zip/' + options.zip_token;
case 'zip_task': return siteRoot + 'api/v2.1/repos/' + options.repo_id + '/zip-task/';
case 'query_zip_progress': return siteRoot + 'api/v2.1/query-zip-progress/';
case 'cancel_zip_task': return siteRoot + 'api/v2.1/cancel-zip-task/';
case 'copy_move_task': return siteRoot + 'api/v2.1/copy-move-task/';
case 'query_copy_move_progress': return siteRoot + 'api/v2.1/query-copy-move-progress/';
case 'rename_dir': return siteRoot + 'api/v2.1/repos/' + options.repo_id + '/dir/';
@@ -1057,6 +1058,18 @@ define([
});
};
var cancelZipTask = function(){
$.ajax({
url: _this.getUrl({name: 'cancel_zip_task'}) + '?token=' + zip_token,
success: function(date) {
clearInterval(interval);
},
error: function(xhr) {
_this.ajaxErrorHandler(xhr);
}
});
};
$.ajax({
url: _this.getUrl({
name: 'zip_task',
@@ -1072,6 +1085,7 @@ define([
zip_token = data['zip_token'];
$tip.html(packagingTip).modal();
$('#simplemodal-container').css({'width':'auto'});
$('.simplemodal-close').click(function(){ cancelZipTask(); });
queryZipProgress();
interval = setInterval(queryZipProgress, 1000);
},