diff options
author | Peter Grassberger <petertheone@gmail.com> | 2016-03-24 16:58:34 (GMT) |
---|---|---|
committer | Peter Grassberger <petertheone@gmail.com> | 2016-03-24 16:58:34 (GMT) |
commit | d67d45412f398b074d3cb2762d98c4139b0ab9bd (patch) | |
tree | f2730f75bba2591bf0b6c79624f5c6a03daf37a9 /www/js/utils.js | |
parent | 2396977fd57fee58eec84ce0ac6fc91b1b0d1dc9 (diff) |
jingles, musicpools: fix renderUploading
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'); + } +} |