summaryrefslogtreecommitdiff
path: root/assets/js/components/file-upload.js
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-26 22:21:07 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-26 22:21:07 -0500
commita371d53e635f1c0aa6097045ac5b59e78962f760 (patch)
tree710921d7d7e82450bc0f01158353de24aa7f6fd2 /assets/js/components/file-upload.js
parentc3d42a21b28805ab0ec3d7bac3530972ca356067 (diff)
Always unbind internal listeners when closing a modal dialog
Diffstat (limited to 'assets/js/components/file-upload.js')
-rw-r--r--assets/js/components/file-upload.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/assets/js/components/file-upload.js b/assets/js/components/file-upload.js
index 762eb6e1..f4445a44 100644
--- a/assets/js/components/file-upload.js
+++ b/assets/js/components/file-upload.js
@@ -2,7 +2,7 @@ KB.component('file-upload', function (containerElement, options) {
var inputFileElement = null;
var dropzoneElement = null;
var files = [];
- var currentFileIndex = null;
+ var currentFileIndex = 0;
function onProgress(e) {
if (e.lengthComputable) {
@@ -183,6 +183,9 @@ KB.component('file-upload', function (containerElement, options) {
this.render = function () {
KB.on('modal.submit', onSubmit);
+ KB.on('modal.close', function () {
+ KB.removeListener('modal.submit', onSubmit);
+ });
inputFileElement = buildFileInputElement();
dropzoneElement = buildDropzoneElement();