diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-03-28 10:01:39 -0700 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-03-28 10:01:39 -0700 |
commit | df31ee5a903efb288dcb217dc13591a4efd46572 (patch) | |
tree | 9f36d970d2b168a1bf1c04862ce7ad8025dd9ad4 /apps | |
parent | 7098bcd4b7fbcfeefa8afb07cda77abccdeb9ed0 (diff) | |
parent | 586a47b186c96cea2cb0e3182fb559e79f1730be (diff) | |
download | nextcloud-server-df31ee5a903efb288dcb217dc13591a4efd46572.tar.gz nextcloud-server-df31ee5a903efb288dcb217dc13591a4efd46572.zip |
Merge pull request #2575 from owncloud/fixing-1461-master
Fix upload progressbar in IE8 and IE9
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/files.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c306f3ab6ab..6c5536aafab 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -407,7 +407,9 @@ $(document).ready(function() { $('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id); var size = $('tr').filterAttr('data-file',file.name).find('td.filesize').text(); if(size==t('files','Pending')){ - $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size); + var sizeElement = $('tr').filterAttr('data-file',file.name).find('td.filesize'); + sizeElement.text(simpleFileSize(file.size)); + sizeElement.attr('title',humanFileSize(file.size)); } //TODO update file upload size limit FileList.loadingDone(file.name, file.id); @@ -438,7 +440,9 @@ $(document).ready(function() { $('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id); var size = $('tr').filterAttr('data-file',file.name).find('td.filesize').text(); if(size==t('files','Pending')){ - $('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size); + var sizeElement = $('tr').filterAttr('data-file',file.name).find('td.filesize'); + sizeElement.text(simpleFileSize(file.size)); + sizeElement.attr('title',humanFileSize(file.size)); } //TODO update file upload size limit FileList.loadingDone(file.name, file.id); @@ -459,6 +463,10 @@ $(document).ready(function() { // TODO: show nice progress bar in file row }, progressall: function(e, data) { + //IE < 10 does not fire the necessary events for the progress bar. + if($.browser.msie && parseInt($.browser.version) < 10) { + return; + } var progress = (data.loaded/data.total)*100; $('#uploadprogressbar').progressbar('value',progress); }, @@ -477,6 +485,11 @@ $(document).ready(function() { if(data.dataType != 'iframe ') { $('#upload input.stop').hide(); } + //IE < 10 does not fire the necessary events for the progress bar. + if($.browser.msie && parseInt($.browser.version) < 10) { + return; + } + $('#uploadprogressbar').progressbar('value',100); $('#uploadprogressbar').fadeOut(); } @@ -637,12 +650,19 @@ $(document).ready(function() { localName=(localName.match(/:\/\/(.[^/]+)/)[1]).replace('www.',''); } localName = getUniqueName(localName); - $('#uploadprogressbar').progressbar({value:0}); - $('#uploadprogressbar').fadeIn(); + //IE < 10 does not fire the necessary events for the progress bar. + if($.browser.msie && parseInt($.browser.version) < 10) { + } else { + $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').fadeIn(); + } var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); eventSource.listen('progress',function(progress){ - $('#uploadprogressbar').progressbar('value',progress); + if($.browser.msie && parseInt($.browser.version) < 10) { + } else { + $('#uploadprogressbar').progressbar('value',progress); + } }); eventSource.listen('success',function(data){ var mime=data.mime; |