summaryrefslogtreecommitdiff
path: root/www/js/jingles.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-02-10 21:10:38 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-02-10 21:10:38 (GMT)
commit6132cd4f057add2c2d1c1fd360a895baa088f2f0 (patch)
treea8626cf4c49e14c69b87d8a13154c86581b780e2 /www/js/jingles.js
parentb1821ae253555aea1e840d4809b1c144a7f5fc15 (diff)
refactor importer: cancel import, shows import, etc.
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r--www/js/jingles.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index 64847dd..72ae3ae 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -32,6 +32,7 @@ function jingles_init() {
}
function jingles_cleanup() {
+ importer.cancelAllUploads();
if (jingleGroupListView) {
jingleGroupListView.destroy();
jingleGroupListView = null;
@@ -108,7 +109,7 @@ Rivendell.JingleGroupView.prototype.render = function() {
$('table tbody tr', this.$el).remove();
$('.uploadButton', this.$el).on('click', function() {
- importer.openModal(self.model, self, false, false);
+ importer.openModal(self.model, self, false, null, false);
});
};
@@ -116,7 +117,7 @@ Rivendell.JingleGroupView.prototype.destroy = function() {
$('table > tbody', this.$el).html('');
};
-Rivendell.JingleGroupView.prototype.uploadProgress = function(file) {
+Rivendell.JingleGroupView.prototype.uploadProgress = function(upload, file) {
if (!file.cartNumber || !file.cutNumber) {
return;
}
@@ -126,6 +127,11 @@ Rivendell.JingleGroupView.prototype.uploadProgress = function(file) {
$progressBar.find('.file-name').text(file.name);
$progressBar.find('.cart-number').text(file.cartNumber);
$cut.html($progressBar.html());
+
+ $('button', $cut).on('click', function() {
+ upload.cancel();
+ });
+
$cut.addClass('uploading');
}
@@ -141,6 +147,10 @@ Rivendell.JingleGroupView.prototype.uploadProgress = function(file) {
}
};
+Rivendell.JingleGroupView.prototype.uploadError = function(upload, file, msg) {
+ // todo
+};
+
Rivendell.JingleCartView = function(model, groupView, active) {
this.model = model;
this.groupView = groupView;