From 965a8ba2c60eb04e2f65a4ace215113ac61f7c98 Mon Sep 17 00:00:00 2001 From: Simon Birnbach Date: Sun, 15 Apr 2012 23:52:36 +0200 Subject: Fixed cancelling of uploads and wrong merge conflict resolution --- files/css/files.css | 6 +++--- files/js/files.js | 42 +++++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 12 deletions(-) (limited to 'files') diff --git a/files/css/files.css b/files/css/files.css index 544b323bb29..5dc7983bec4 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -42,9 +42,9 @@ tbody tr { background-color:#fff; height:2.5em; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; } tbody tr.selected { background-color:#eee; } tbody a { color:#000; } -span.extention, span.uploading, td.date { color:#999; } -span.extention { opacity:0; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; } -tr:hover span.extention { opacity:1; } +span.extension, span.uploading, td.date { color:#999; } +span.extension { text-transform:lowercase; opacity:0; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; } +tr:hover span.extension { opacity:1; } div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; } div.crumb:first-child { padding-left:1em; } div.crumb.last { font-weight:bold; } diff --git a/files/js/files.js b/files/js/files.js index a7a4d3077c1..56fff753737 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -9,13 +9,20 @@ Files={ return false; }, cancelUploads:function() { - $.each(uploadingFiles,function(index,file){ - file.abort(); + $.each(uploadingFiles,function(index,file) { + if(typeof file['abort'] === 'function') { + file.abort(); + var filename = $('tr').filterAttr('data-file',index); + filename.hide(); + filename.find('input[type="checkbox"]').removeAttr('checked'); + filename.removeClass('selected'); + } else { + $.each(file,function(i,f) { + f.abort(); + delete file[i]; + }); + } delete uploadingFiles[index]; - var filename = $('tr').filterAttr('data-file',index); - filename.hide(); - filename.find('input[type="checkbox"]').removeAttr('checked'); - filename.removeClass('selected'); }); procesSelection(); } @@ -206,8 +213,9 @@ $(document).ready(function() { }else{ if($.support.xhrFileUpload) { for(var i=0;i