mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
delete_btn_controller: Keep the value and name of the original clicked button
This fixes an error message when undoing or reverting a log entry
This commit is contained in:
parent
49b6a42791
commit
e4285bbc78
2 changed files with 11 additions and 2 deletions
|
@ -44,6 +44,7 @@ export default class extends Controller
|
|||
const title = this.element.dataset.deleteTitle;
|
||||
|
||||
const form = this.element;
|
||||
const submitter = event.submitter;
|
||||
const that = this;
|
||||
|
||||
const confirm = bootbox.confirm({
|
||||
|
@ -58,6 +59,14 @@ export default class extends Controller
|
|||
const submit_btn = document.createElement('button');
|
||||
submit_btn.type = 'submit';
|
||||
submit_btn.style.display = 'none';
|
||||
|
||||
//If the clicked button has a value, set it on the submit button
|
||||
if (submitter.value) {
|
||||
submit_btn.value = submitter.value;
|
||||
}
|
||||
if (submitter.name) {
|
||||
submit_btn.name = submitter.name;
|
||||
}
|
||||
form.appendChild(submit_btn);
|
||||
submit_btn.click();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue