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/shows.js | |
parent | 2396977fd57fee58eec84ce0ac6fc91b1b0d1dc9 (diff) |
jingles, musicpools: fix renderUploading
Diffstat (limited to 'www/js/shows.js')
-rw-r--r-- | www/js/shows.js | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/www/js/shows.js b/www/js/shows.js index b910bdb..0e5c776 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -204,7 +204,7 @@ Rivendell.ShowView.prototype.render = function() { var cartView = new Rivendell.ShowCartView(cart, self); self.cartViews.push(cartView); var upload = null; - if ((upload = importer.getUploadByCartId(log.cartNumber)) !== null) { + if ((upload = importer.getUploadByCartNumber(log.cartNumber)) !== null) { cartView.renderUploading(upload); } else { cartView.render(); @@ -235,16 +235,7 @@ Rivendell.ShowView.prototype.uploadProgress = function(upload, file) { $cart.addClass('uploading'); } - 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"; - $cart.find('.file-bytes').text(bytes_str); - $cart.find('.progress .progress-bar').css("width", upload.uploadprogress.progress + "%"); - } else { - $cart.find('.file-bytes').text('importiere...'); - $cart.find('.progress .progress-bar').css('width', '100%'); - $cart.find('.progress .progress-bar').addClass('progress-bar-striped').addClass('active'); - } + updateProgressBar($cart, upload); }; Rivendell.ShowView.prototype.uploadError = function(upload, file, msg, xhr, acknowledge) { @@ -324,6 +315,7 @@ Rivendell.ShowCartView.prototype.renderUploading = function(upload) { $('.cart-number', $progressBar).text(this.model.number); this.$el.empty() + .attr('id', 'show-cart-' + this.model.number) .html($progressBar.html()) .attr('id', 'show-cart-' + this.model.number) .addClass('uploading'); @@ -332,16 +324,7 @@ Rivendell.ShowCartView.prototype.renderUploading = function(upload) { upload.cancel(); }); - 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"; - this.$el.find('.file-bytes').text(bytes_str); - this.$el.find('.progress .progress-bar').css("width", upload.uploadprogress.progress + "%"); - } else { - this.$el.find('.file-bytes').text('importiere...'); - this.$el.find('.progress .progress-bar').css('width', '100%'); - this.$el.find('.progress .progress-bar').addClass('progress-bar-striped').addClass('active'); - } + updateProgressBar(this.$el, upload); }; Rivendell.ShowCartView.renderEmpty = function(group, groupView, cartNumber) { |