mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-01 06:41:41 +00:00
12398: add slide-out animation
This commit is contained in:
@@ -17,9 +17,6 @@ export default class extends Controller {
|
||||
const modalId = this.targetValue;
|
||||
const moodalConfirmButtonQuery = `#${modalId} #modal-confirm-button`;
|
||||
const confirmButton = document.querySelector(moodalConfirmButtonQuery);
|
||||
|
||||
this.#setPathToFormAction(confirmButton);
|
||||
|
||||
Object.keys(this.modalDatasetValue).forEach((datasetKey) => {
|
||||
confirmButton.setAttribute(datasetKey, this.modalDatasetValue[datasetKey]);
|
||||
});
|
||||
@@ -33,16 +30,4 @@ export default class extends Controller {
|
||||
getIdentifier() {
|
||||
return "modal";
|
||||
}
|
||||
|
||||
#setPathToFormAction(confirmButton) {
|
||||
const isSubmitButton = confirmButton.type === 'submit';
|
||||
const path = this.modalDatasetValue['data-path'];
|
||||
|
||||
if(isSubmitButton && path){
|
||||
const form = confirmButton.parentElement;
|
||||
form.setAttribute('action', path);
|
||||
|
||||
delete this.modalDatasetValue['data-path'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user