33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 02:49:01 +00:00
This commit is contained in:
Dimitris Grammatikogiannis 2023-10-10 13:00:31 +03:00 committed by GitHub
parent c87730187c
commit d68b24ed7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,11 +23,12 @@ Joomla.submitbutton = (task) => {
* @param {Event} event
*/
document.querySelectorAll(".submitPatch").forEach((element) => element.addEventListener("click", (event) => {
const value = document.getElementById('pull_id')?.value;
const element = document.getElementById('pull_id');
const target = event.currentTarget;
if (value) {
value = parseInt(event.currentTarget.dataset.id);
if (element) {
element.value = parseInt(target.dataset.id);
}
Joomla.submitform(`${event.currentTarget.dataset.task}.${currentTarget.dataset.task}`);
Joomla.submitform(`${target.dataset.task}.${target.dataset.task}`);
}));