diff options
author | Peter Grassberger <petertheone@gmail.com> | 2016-02-22 18:59:00 (GMT) |
---|---|---|
committer | Peter Grassberger <petertheone@gmail.com> | 2016-02-22 18:59:00 (GMT) |
commit | 64b27a0914f7d6f3f6c60001c3a66fd7d432421e (patch) | |
tree | 7bd6d18bf905016504a60669f9af93fb907e2086 /www/js/importer.js | |
parent | 502912ed02337c8b3420b9c3acf328e822c2c4f3 (diff) |
Warn about running uploads
Diffstat (limited to 'www/js/importer.js')
-rw-r--r-- | www/js/importer.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/www/js/importer.js b/www/js/importer.js index c5b48df..5f7db6f 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -86,6 +86,16 @@ Rivendell.Importer.prototype.openModal = function(group, groupView, createCart, this.$el.modal({keyboard: true}); }; +Rivendell.Importer.prototype.isUploading = function() { + var $result = false; + $.each(this.uploads, function(index, upload) { + if (upload && upload.isUploading()) { + $result = true; + } + }); + return $result; +}; + Rivendell.Importer.prototype.cancelAllUploads = function() { $.each(this.uploads, function(index, upload){ if (upload) { @@ -117,6 +127,11 @@ Rivendell.Upload = function(group, groupView, createCart, newCartNumber, useMeta this.import(); }; +Rivendell.Upload.prototype.isUploading = function() { + var files = this.dropzone.getUploadingFiles(); + return files.length > 0; +}; + Rivendell.Upload.prototype.cancel = function() { this.dropzone.off(Dropzone.ERROR); this.dropzone.removeAllFiles(true); |