Skip to content

Commit

Permalink
Refactor -- remove anonymous function handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gary02 committed Oct 15, 2024
1 parent 10c44fc commit 06eb2d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ target/
node_modules

*.min.js
.python-version
13 changes: 8 additions & 5 deletions s3file/static/s3file/js/s3file.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@
})
}

function uploadS3Inputs (form, submitter) {
function uploadS3Inputs (event) {

event.preventDefault()

var form = event.target
var submitter = event.submitter

window.uploading = 0
form.loaded = 0
form.total = 0
Expand Down Expand Up @@ -151,10 +157,7 @@
})
forms = new Set(forms)
forms.forEach(function (form) {
form.addEventListener('submit', function (e) {
e.preventDefault()
uploadS3Inputs(e.target, e.submitter)
})
form.addEventListener('submit', uploadS3Inputs)
})
})
})()

0 comments on commit 06eb2d9

Please sign in to comment.