summaryrefslogtreecommitdiff
path: root/www/js/musicpools.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-07-17 17:19:50 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-07-17 17:19:50 (GMT)
commit49aab5316d471542677f6be931da7c2ad14c3ef8 (patch)
tree50486c0640ff3dee268e992f412bba8189c1a86c /www/js/musicpools.js
parenteee0121b10ac9e4d1aad7a8347d158d3c02fa4ba (diff)
fix upload progress dom update
Diffstat (limited to 'www/js/musicpools.js')
-rw-r--r--www/js/musicpools.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/www/js/musicpools.js b/www/js/musicpools.js
index ad1a532..7fdb3c6 100644
--- a/www/js/musicpools.js
+++ b/www/js/musicpools.js
@@ -177,8 +177,13 @@ Rdxport.MusicpoolView.prototype.render = function() {
});
var uploads = importer.getUploadsByGroupName(this.model.name);
$(uploads).each(function(index, upload) {
- var $el = Rdxport.MusicpoolCartView.renderUploading(upload, self.model.number);
- $('table > tbody', self.$el).append($el);
+ var $el = Rdxport.MusicpoolCartView.renderUploading(upload);
+ var $cart = $('#musicpool-' + upload.cartNumber, self.$el);
+ if (upload.cartNumber && $cart.length > 0) {
+ $cart.replaceWith($el);
+ } else {
+ $('table > tbody', self.$el).append($el);
+ }
if (upload.error) {
self.uploadError(upload);
}
@@ -300,10 +305,13 @@ Rdxport.MusicpoolCartView.renderUploading = function(upload) {
var $el = $('<tr>')
.html($progressBar.html())
- .attr('id', 'musicpool-upload-' + upload.uploadId)
.addClass('uploading')
.attr('data-upload-id', upload.uploadId);
+ if (upload.cartNumber) {
+ $el.attr('id', 'musicpool-' + upload.cartNumber);
+ }
+
$('button', $el).on('click', function() {
upload.cancel();
});