mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2025-01-02 22:50:27 +00:00
Update patchtester.js
This commit is contained in:
parent
012d39a316
commit
2434668162
@ -22,9 +22,8 @@ const PatchTester = {
|
|||||||
* @param {String} task The task to perform
|
* @param {String} task The task to perform
|
||||||
* @param {Number} id The item ID
|
* @param {Number} id The item ID
|
||||||
*/
|
*/
|
||||||
submitpatch: function (task, id) {
|
submitpatch: (task, id) => {
|
||||||
var idField = document.getElementById('pull_id');
|
document.getElementById('pull_id')?.value = id;
|
||||||
idField.value = id;
|
|
||||||
|
|
||||||
Joomla.submitform(task);
|
Joomla.submitform(task);
|
||||||
}
|
}
|
||||||
@ -37,13 +36,7 @@ const PatchTester = {
|
|||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*/
|
*/
|
||||||
function patchSubmit(event) {
|
const patchSubmit = (event) => PatchTester.submitpatch(`${event.currentTarget.dataset.task}.${currentTarget.dataset.task}`, parseInt(event.currentTarget.dataset.id));
|
||||||
const currentTarget = event.currentTarget;
|
|
||||||
const task = `${currentTarget.dataset.task}.${currentTarget.dataset.task}`
|
|
||||||
const id = parseInt(currentTarget.dataset.id)
|
|
||||||
|
|
||||||
PatchTester.submitpatch(task, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
document.querySelectorAll(".submitPatch").forEach((element) => element.addEventListener("click", patchSubmit));
|
document.querySelectorAll(".submitPatch").forEach((element) => element.addEventListener("click", patchSubmit));
|
||||||
|
Loading…
Reference in New Issue
Block a user