some format changes
This commit is contained in:
parent
572cc1eb89
commit
32133a0d05
|
@ -11,10 +11,8 @@ function addAddress(url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function editAddress(id) {
|
function editAddress(id) {
|
||||||
console.log("editButon")
|
|
||||||
if (document.getElementById('edit_button_' + id).value === 'Save') {
|
if (document.getElementById('edit_button_' + id).value === 'Save') {
|
||||||
// save
|
// save
|
||||||
console.log("save")
|
|
||||||
const url = "/address/update";
|
const url = "/address/update";
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -32,8 +30,8 @@ function editAddress(id) {
|
||||||
.then(
|
.then(
|
||||||
response => response.text()
|
response => response.text()
|
||||||
).then(
|
).then(
|
||||||
html => console.log(html)
|
html => console.log(html)
|
||||||
);
|
);
|
||||||
|
|
||||||
document.getElementById('first_' + id).disabled = true
|
document.getElementById('first_' + id).disabled = true
|
||||||
document.getElementById('last_' + id).disabled = true
|
document.getElementById('last_' + id).disabled = true
|
||||||
|
@ -45,7 +43,6 @@ function editAddress(id) {
|
||||||
document.getElementById('edit_button_' + id).value = 'Edit'
|
document.getElementById('edit_button_' + id).value = 'Edit'
|
||||||
} else {
|
} else {
|
||||||
//switch to edit
|
//switch to edit
|
||||||
console.log("switch to edit")
|
|
||||||
document.getElementById('first_' + id).disabled = false
|
document.getElementById('first_' + id).disabled = false
|
||||||
document.getElementById('last_' + id).disabled = false
|
document.getElementById('last_' + id).disabled = false
|
||||||
document.getElementById('street_' + id).disabled = false
|
document.getElementById('street_' + id).disabled = false
|
||||||
|
@ -58,7 +55,6 @@ function editAddress(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteAddress(id) {
|
function deleteAddress(id) {
|
||||||
console.log("del")
|
|
||||||
if (confirm('Are you sure?')) {
|
if (confirm('Are you sure?')) {
|
||||||
const url = "/address/delete";
|
const url = "/address/delete";
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
|
@ -70,8 +66,8 @@ function deleteAddress(id) {
|
||||||
.then(
|
.then(
|
||||||
response => response.text()
|
response => response.text()
|
||||||
).then(
|
).then(
|
||||||
html => console.log(html)
|
html => console.log(html)
|
||||||
);
|
);
|
||||||
let row = document.getElementById('row_' + id)
|
let row = document.getElementById('row_' + id)
|
||||||
row.parentNode.removeChild(row)
|
row.parentNode.removeChild(row)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue