style(spinner): fix positioning for conditional champs
This commit is contained in:
parent
5aa4a117c8
commit
d56e3908ac
3 changed files with 5 additions and 5 deletions
|
@ -514,7 +514,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset ~ .spinner {
|
fieldset + .spinner {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -($default-fields-spacer / 2);
|
top: -($default-fields-spacer / 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,12 +124,12 @@ export class AutosaveController extends ApplicationController {
|
||||||
private showSpinner(champElement: Element) {
|
private showSpinner(champElement: Element) {
|
||||||
this.#spinnerTimeoutId = setTimeout(() => {
|
this.#spinnerTimeoutId = setTimeout(() => {
|
||||||
// do not do anything if there is already a spinner for this champ, like SIRET champ
|
// do not do anything if there is already a spinner for this champ, like SIRET champ
|
||||||
if (!champElement.querySelector('.spinner')) {
|
if (!champElement.nextElementSibling?.classList.contains('spinner')) {
|
||||||
const spinner = document.createElement('div');
|
const spinner = document.createElement('div');
|
||||||
spinner.classList.add('spinner', 'spinner-removable');
|
spinner.classList.add('spinner', 'spinner-removable');
|
||||||
spinner.setAttribute('aria-live', 'live');
|
spinner.setAttribute('aria-live', 'live');
|
||||||
spinner.setAttribute('aria-label', 'Chargement en cours…');
|
spinner.setAttribute('aria-label', 'Chargement en cours…');
|
||||||
champElement.appendChild(spinner);
|
champElement.insertAdjacentElement('afterend', spinner);
|
||||||
}
|
}
|
||||||
}, AUTOSAVE_CONDITIONAL_SPINNER_DEBOUNCE_DELAY);
|
}, AUTOSAVE_CONDITIONAL_SPINNER_DEBOUNCE_DELAY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
= turbo_stream.update champ.labelledby_id do
|
= turbo_stream.update champ.labelledby_id do
|
||||||
= render EditableChamp::ChampLabelContentComponent.new champ:, form:
|
= render EditableChamp::ChampLabelContentComponent.new champ:, form:
|
||||||
|
|
||||||
= turbo_stream.remove_all(".editable-champ .spinner-removable")
|
= turbo_stream.remove_all(".editable-champ + .spinner-removable")
|
||||||
= turbo_stream.hide_all(".editable-champ .spinner")
|
= turbo_stream.hide_all(".editable-champ + .spinner")
|
||||||
|
|
||||||
- if dossier.present?
|
- if dossier.present?
|
||||||
= turbo_stream.replace_all '.dossier-edit-sticky-footer' do
|
= turbo_stream.replace_all '.dossier-edit-sticky-footer' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue