diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-20 17:24:10 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-20 17:24:10 +0200 |
commit | ef3eebfd3e46276aa58d722e4e8986946872439c (patch) | |
tree | fc0d36bbbbadf1207104c431036d814d796401be /apps/files | |
parent | cb0464ca4e13a6bf206e94972eba12c3cedd4e2a (diff) | |
download | nextcloud-server-ef3eebfd3e46276aa58d722e4e8986946872439c.tar.gz nextcloud-server-ef3eebfd3e46276aa58d722e4e8986946872439c.zip |
Fix deletion for browser that do not support onBeforeUnload, fixes oc-1534.
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/filelist.js | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index a414c5f8303..6ba3f3555ea 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -151,7 +151,7 @@ FileList={ } }); } - + } tr.attr('data-file', newname); var path = td.children('a.name').attr('href'); @@ -189,7 +189,7 @@ FileList={ FileList.replaceCanceled = false; FileList.replaceOldName = oldName; FileList.replaceNewName = newName; - FileList.lastAction = function() { + FileList.lastAction = function() { FileList.finishReplace(); }; $('#notification').html(t('files', 'replaced')+' '+newName+' '+t('files', 'with')+' '+oldName+'<span class="undo">'+t('files', 'undo')+'</span>'); @@ -236,23 +236,13 @@ FileList={ do_delete:function(files){ // Finish any existing actions if (FileList.lastAction || !FileList.useUndo) { + if(!FileList.deleteFiles) { + FileList.prepareDeletion(files); + } FileList.lastAction(); + return; } - if(files.substr){ - files=[files]; - } - $.each(files,function(index,file){ - var files = $('tr').filterAttr('data-file',file); - files.hide(); - files.find('input[type="checkbox"]').removeAttr('checked'); - files.removeClass('selected'); - }); - procesSelection(); - FileList.deleteCanceled=false; - FileList.deleteFiles=files; - FileList.lastAction = function() { - FileList.finishDelete(null, true); - }; + FileList.prepareDeletion(files); $('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); $('#notification').fadeIn(); }, @@ -279,6 +269,23 @@ FileList={ } }); } + }, + prepareDeletion:function(files){ + if(files.substr){ + files=[files]; + } + $.each(files,function(index,file){ + var files = $('tr').filterAttr('data-file',file); + files.hide(); + files.find('input[type="checkbox"]').removeAttr('checked'); + files.removeClass('selected'); + }); + procesSelection(); + FileList.deleteCanceled=false; + FileList.deleteFiles=files; + FileList.lastAction = function() { + FileList.finishDelete(null, true); + }; } } |