update service submit name for new or edit action

This commit is contained in:
BlasenhauerJ 2023-04-26 15:05:11 +02:00
parent 53e145b919
commit 1321a76c0c
1 changed files with 9 additions and 0 deletions

View File

@ -72,6 +72,7 @@ class ServiceModal {
const obj = JSON.parse(servicesSettings);
this.updateModalData(obj);
//show modal
this.changeSubmitBtnName("EDIT");
this.openModal();
}
} catch (err) {}
@ -92,6 +93,7 @@ class ServiceModal {
inpServName.value = "";
//show modal
this.changeSubmitBtnName("CREATE");
this.openModal();
}
} catch (err) {}
@ -111,6 +113,13 @@ class ServiceModal {
});
}
changeSubmitBtnName(text) {
const submitBtn = document.querySelector(
"button[data-services-modal-submit]"
);
submitBtn.textContent = text;
}
setSettingsDefault() {
const inps = this.modal.querySelectorAll("input");
inps.forEach((inp) => {