Browse Source

Moved file input handler back up into document ready

master
Teknikode 3 years ago
parent
commit
e3d9fdcd41
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      scripts/popup.js

+ 8
- 5
scripts/popup.js View File

@@ -8,10 +8,10 @@ $(document).ready(function () {
// Prompt for uploading a file
$('#files').click();
});
});
document.getElementById('files').addEventListener('change', function (evt) {
var files = evt.target.files;
// Handle the addition of files
$('#files').change(function (e) {
var files = e.target.files;
for (var i = 0; i < files.length; i++) {
var f = files[i];
var fileUrl = window.URL.createObjectURL(f);
@@ -20,7 +20,10 @@ document.getElementById('files').addEventListener('change', function (evt) {
file: fileUrl
});
}
}, false);
var fileObj = $('#files');
fileObj.replaceWith(fileObj = fileObj.clone(true));
});
});

// When loaded, call the background to add processes
var sendingMessage = browser.runtime.sendMessage({

Loading…
Cancel
Save