javascript: move the autosave files to a sub-directory

This commit is contained in:
Pierre de La Morinerie 2020-03-19 16:48:21 +00:00
parent 7e513cc5f6
commit e908b42b43
3 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import { fire, timeoutable } from '@utils';
// Manages a queue of Autosave operations,
// and sends `autosave:*` events to indicate the state of the requests.
export default class AutosaveController {
export default class AutoSaveController {
constructor() {
this.timeoutDelay = 60000; // 1mn
this.latestPromise = Promise.resolve();

View file

@ -1,4 +1,4 @@
import AutosaveController from './autosave-controller.js';
import AutoSaveController from './auto-save-controller.js';
import {
debounce,
delegate,
@ -14,7 +14,7 @@ const AUTOSAVE_DEBOUNCE_DELAY = gon.autosave.debounce_delay;
const AUTOSAVE_STATUS_VISIBLE_DURATION = gon.autosave.status_visible_duration;
// Create a controller responsible for queuing autosave operations.
const autosaveController = new AutosaveController();
const autoSaveController = new AutoSaveController();
// Whenever a 'change' event is triggered on one of the form inputs, try to autosave.
@ -26,13 +26,13 @@ delegate(
formInputsSelector,
debounce(() => {
const form = document.querySelector(formSelector);
autosaveController.enqueueAutosaveRequest(form);
autoSaveController.enqueueAutosaveRequest(form);
}, AUTOSAVE_DEBOUNCE_DELAY)
);
delegate('click', '.autosave-retry', () => {
const form = document.querySelector(formSelector);
autosaveController.enqueueAutosaveRequest(form);
autoSaveController.enqueueAutosaveRequest(form);
});
// Display some UI during the autosave

View file

@ -16,13 +16,13 @@ import '../shared/franceconnect';
import '../shared/toggle-target';
import '../new_design/dropdown';
import '../new_design/autosave';
import '../new_design/form-validation';
import '../new_design/procedure-context';
import '../new_design/procedure-form';
import '../new_design/select2';
import '../new_design/spinner';
import '../new_design/support';
import '../new_design/dossiers/auto-save';
import '../new_design/champs/carte';
import '../new_design/champs/linked-drop-down-list';