javascript: add some comments to the upload systems
This commit is contained in:
parent
2a1c91a2a5
commit
a1083ca253
3 changed files with 10 additions and 1 deletions
|
@ -27,6 +27,8 @@ addUploadEventListener(INITIALIZE_EVENT, ({ target, detail: { id, file } }) => {
|
||||||
|
|
||||||
addUploadEventListener(START_EVENT, ({ target, detail: { id } }) => {
|
addUploadEventListener(START_EVENT, ({ target, detail: { id } }) => {
|
||||||
ProgressBar.start(id);
|
ProgressBar.start(id);
|
||||||
|
// At the end of the upload, the form will be submitted again.
|
||||||
|
// Avoid the confirm dialog to be presented again then.
|
||||||
const button = target.form.querySelector('button.primary');
|
const button = target.form.querySelector('button.primary');
|
||||||
if (button) {
|
if (button) {
|
||||||
button.removeAttribute('data-confirm');
|
button.removeAttribute('data-confirm');
|
||||||
|
|
|
@ -3,7 +3,7 @@ import ProgressBar from './progress-bar';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Uploader class is a delegate for DirectUpload instance
|
Uploader class is a delegate for DirectUpload instance
|
||||||
used to track lifecycle and progress of un upload.
|
used to track lifecycle and progress of an upload.
|
||||||
*/
|
*/
|
||||||
export default class Uploader {
|
export default class Uploader {
|
||||||
constructor(input, file, directUploadUrl) {
|
constructor(input, file, directUploadUrl) {
|
||||||
|
|
|
@ -29,6 +29,13 @@ delegate('click', '[data-attachment-refresh]', event => {
|
||||||
attachementPoller.check();
|
attachementPoller.check();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Periodically check the state of a set of URLs.
|
||||||
|
//
|
||||||
|
// Each time the given URL is requested, the matching `show.js.erb` view is rendered,
|
||||||
|
// causing the state to be refreshed.
|
||||||
|
//
|
||||||
|
// This is used mainly to refresh attachments during the anti-virus check,
|
||||||
|
// but also to refresh the state of a pending spreadsheet export.
|
||||||
class RemotePoller {
|
class RemotePoller {
|
||||||
urls = new Set();
|
urls = new Set();
|
||||||
timeout;
|
timeout;
|
||||||
|
|
Loading…
Reference in a new issue