update service submit name for new or edit action
This commit is contained in:
parent
53e145b919
commit
1321a76c0c
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue