diff options
Diffstat (limited to 'www/js/utils.js')
-rw-r--r-- | www/js/utils.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/www/js/utils.js b/www/js/utils.js index fab6736..97f06e7 100644 --- a/www/js/utils.js +++ b/www/js/utils.js @@ -140,3 +140,16 @@ jQuery.fn.brightness = function() { if (this.parent().length) return this.parent().brightness(); } }; + +function updateProgressBar($el, upload) { + if(upload.uploadprogress.progress < 99) { + var bytes_str = Number((upload.uploadprogress.bytesSent/1024)/1024).toFixed(1) + " von " + + Number((upload.uploadprogress.total/1024)/1024).toFixed(1) + " MB"; + $el.find('.file-bytes').text(bytes_str); + $el.find('.progress .progress-bar').css("width", upload.uploadprogress.progress + "%"); + } else { + $el.find('.file-bytes').text('importiere...'); + $el.find('.progress .progress-bar').css('width', '100%'); + $el.find('.progress .progress-bar').addClass('progress-bar-striped').addClass('active'); + } +} |