Skip to content

Commit

Permalink
Merge pull request #29 from uploadcare/hotfix/remove-onadd-onremove-h…
Browse files Browse the repository at this point in the history
…andlers

fix: remove onAdd/onRemove handlers
  • Loading branch information
optlsnd authored Feb 14, 2024
2 parents 622f7ad + b593c8c commit af94176
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,33 +139,6 @@ JFCustomWidget.subscribe('ready', function(data) {
}
})

widget.onDialogOpen(function(dialog) {
dialog.fileColl.onAdd.add(function() {
files = []
// eslint-disable-next-line no-underscore-dangle
Promise.all(dialog.fileColl.__items).then(function(result) {
files = result.map(function(fileInfo) {
var fileName = (addFileName) ? sanitizeFileName(fileInfo.name) : ''

return fileInfo.cdnUrl + customString + fileName
})
JFCustomWidget.sendData({value: files.join('\n')})
})
})
dialog.fileColl.onRemove.add(function() {
files = []
// eslint-disable-next-line no-underscore-dangle
Promise.all(dialog.fileColl.__items).then(function(result) {
files = result.map(function(fileInfo) {
var fileName = (addFileName) ? sanitizeFileName(fileInfo.name) : ''

return fileInfo.cdnUrl + customString + fileName
})
JFCustomWidget.sendData({value: files.join('\n')})
})
})
})

JFCustomWidget.subscribe('submit', function() {
var msg = {
valid: !!files.length,
Expand Down

0 comments on commit af94176

Please sign in to comment.