allow for editing of vendor in one line, just front end
This commit is contained in:
parent
71727b58a7
commit
6afd48aa6e
1 changed files with 20 additions and 1 deletions
|
|
@ -10,12 +10,31 @@ function startEditMode(id){
|
||||||
for(let i = 0; i < reassignButtons.length; i++){
|
for(let i = 0; i < reassignButtons.length; i++){
|
||||||
reassignButtons[i].disabled = true;
|
reassignButtons[i].disabled = true;
|
||||||
}
|
}
|
||||||
document.addEventListener('')
|
|
||||||
|
const handleKeydown = (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
document.removeEventListener('keydown', handleKeydown);
|
||||||
|
const vendor = document.getElementById(`vendor-line-${id}`);
|
||||||
|
const vendorInput = document.getElementById(`vendor-input-${id}`);
|
||||||
|
vendor.innerText = vendorInput.value;
|
||||||
|
if (vendorInput.parentNode) {
|
||||||
|
vendorInput.parentNode.removeChild(vendorInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let i = 0; i < reassignButtons.length; i++){
|
||||||
|
reassignButtons[i].disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('keydown', handleKeydown);
|
||||||
|
|
||||||
const vendor = document.getElementById(`vendor-line-${id}`);
|
const vendor = document.getElementById(`vendor-line-${id}`);
|
||||||
var placeholderText = vendor.innerText
|
var placeholderText = vendor.innerText
|
||||||
vendor.innerText = ''
|
vendor.innerText = ''
|
||||||
var inputElem = document.createElement("input");
|
var inputElem = document.createElement("input");
|
||||||
inputElem.value = placeholderText;
|
inputElem.value = placeholderText;
|
||||||
|
inputElem.id = `vendor-input-${id}`
|
||||||
vendor.appendChild(inputElem);
|
vendor.appendChild(inputElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue