Created
October 23, 2019 08:16
-
-
Save thanapongp/292b3c0ce8026402658169f773cdd75f to your computer and use it in GitHub Desktop.
performEdit method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
performEdit(item, editInput) { | |
const itemNameEl = item.getElementsByClassName('item-name')[0]; | |
const editButtonEl = item.getElementsByClassName('edit-button')[0]; | |
if (editInput.value.trim().length !== 0) { | |
itemNameEl.innerHTML = editInput.value.trim(); | |
} | |
editInput.remove(); | |
itemNameEl.classList.remove('hidden'); | |
editButtonEl.classList.remove('hidden'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment