diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-05-23 19:02:50 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-27 11:11:34 +0200 |
commit | ec4cf96f0d4f170b21d77378e4f11b88b01aaebc (patch) | |
tree | dde1e495ee09e86f3ab7b213084c8766ba5533cf /apps/files/js/file-upload.js | |
parent | 8aa51a69fae60b7b4cb415d923a9978f5698fe0d (diff) | |
download | nextcloud-server-ec4cf96f0d4f170b21d77378e4f11b88b01aaebc.tar.gz nextcloud-server-ec4cf96f0d4f170b21d77378e4f11b88b01aaebc.zip |
Breadcrumb width calculation fix
Rewrote the breadcrumb calculation to be more readable.
Breadcrumb now has a setMaxWidth() method to set the maximum allowed
width which is used to fit the breadcrumbs.
The breadcrumb width is now based on the container width, passed through
setMaxWidth() by the FileList class.
Now using fixed widths for the test crumbs to simulate consistent
widths across browsers which rendering engines might usually yield
different results.
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r-- | apps/files/js/file-upload.js | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index da58e1c31b8..2637d13f9ba 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -179,9 +179,20 @@ OC.Upload = { callbacks.onNoConflicts(selection); }, + _hideProgressBar: function() { + $('#uploadprogresswrapper input.stop').fadeOut(); + $('#uploadprogressbar').fadeOut(function() { + $('#file_upload_start').trigger(new $.Event('resized')); + }); + }, + + _showProgressBar: function() { + $('#uploadprogressbar').fadeIn(); + $('#file_upload_start').trigger(new $.Event('resized')); + }, + init: function() { if ( $('#file_upload_start').exists() ) { - var file_upload_param = { dropZone: $('#content'), // restrict dropZone to content div autoUpload: false, @@ -444,7 +455,7 @@ OC.Upload = { OC.Upload.log('progress handle fileuploadstart', e, data); $('#uploadprogresswrapper input.stop').show(); $('#uploadprogressbar').progressbar({value: 0}); - $('#uploadprogressbar').fadeIn(); + OC.Upload._showProgressBar(); }); fileupload.on('fileuploadprogress', function(e, data) { OC.Upload.log('progress handle fileuploadprogress', e, data); @@ -458,15 +469,13 @@ OC.Upload = { fileupload.on('fileuploadstop', function(e, data) { OC.Upload.log('progress handle fileuploadstop', e, data); - $('#uploadprogresswrapper input.stop').fadeOut(); - $('#uploadprogressbar').fadeOut(); + OC.Upload._hideProgressBar(); }); fileupload.on('fileuploadfail', function(e, data) { OC.Upload.log('progress handle fileuploadfail', e, data); //if user pressed cancel hide upload progress bar and cancel button if (data.errorThrown === 'abort') { - $('#uploadprogresswrapper input.stop').fadeOut(); - $('#uploadprogressbar').fadeOut(); + OC.Upload._hideProgressBar(); } }); @@ -649,7 +658,7 @@ OC.Upload = { //IE < 10 does not fire the necessary events for the progress bar. if ($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar({value: 0}); - $('#uploadprogressbar').fadeIn(); + OC.Upload._showProgressBar(); } var eventSource = new OC.EventSource( @@ -668,12 +677,12 @@ OC.Upload = { }); eventSource.listen('success', function(data) { var file = data; - $('#uploadprogressbar').fadeOut(); + OC.Upload._hideProgressBar(); FileList.add(file, {hidden: hidden, animate: true}); }); eventSource.listen('error', function(error) { - $('#uploadprogressbar').fadeOut(); + OC.Upload._hideProgressBar(); var message = (error && error.message) || t('core', 'Error fetching URL'); OC.Notification.show(message); //hide notification after 10 sec |