Index: arms/js/reqAddTable.js =================================================================== diff -u -r6838beea00e7485c7171672bd320c843c8955696 -rc2329eb5e0b5b4b0edb95b950edb6168b8d88578 --- arms/js/reqAddTable.js (.../reqAddTable.js) (revision 6838beea00e7485c7171672bd320c843c8955696) +++ arms/js/reqAddTable.js (.../reqAddTable.js) (revision c2329eb5e0b5b4b0edb95b950edb6168b8d88578) @@ -483,6 +483,7 @@ btn.appendChild(editIcon); const text = document.createTextNode(cur[key] ?? ""); btn.appendChild(text); + const tempText = cur[key] ; btn.addEventListener("click", function(e) { const input = that.makeElement("input"); input.id = uuid; @@ -493,11 +494,18 @@ input.focus(); // 입력 필드에 자동으로 포커스를 줌 input.addEventListener("blur", () => { - cur[key] = input.value; - const updatedBtn = that.makeEditableButton(cur, key); - input.parentNode.replaceChild(updatedBtn, input); - editContents.content = cur[key]; - that.updateData(cur['id'],editContents); + console.log(input.value); + if (tempText !== input.value){ + cur[key] = input.value; + const updatedBtn = that.makeEditableButton(cur, key); + input.parentNode.replaceChild(updatedBtn, input); + editContents.content = cur[key]; + that.updateData(cur['id'],editContents); + }else{ + cur[key] = input.value; + const updatedBtn = that.makeEditableButton(cur, key); + input.parentNode.replaceChild(updatedBtn, input); + } }); input.addEventListener("keyup", function(e) { @@ -521,7 +529,10 @@ const $col = this.makeElement(tag); $col.className = key; - if (cur[key]) { + + if(['content'].includes($col.className)){ + $col.prepend(this.makeEditableButton(cur, key)); + }else if (cur[key]) { $col.innerHTML = cur[key]; } @@ -548,9 +559,7 @@ const checkedAttribute = $col.innerHTML === "1" ? " checked" : ""; $col.innerHTML = ``; } - /*else if(['content'].includes($col.className)){ - $col.prepend(this.makeEditableButton(cur, key)); - }*/ + } if (cur.root === key) {