File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,8 @@ const PatchTester = {
2222 * @param {String } task The task to perform
2323 * @param {Number } id The item ID
2424 */
25- submitpatch : function ( task , id ) {
26- var idField = document . getElementById ( 'pull_id' ) ;
27- idField . value = id ;
25+ submitpatch : ( task , id ) => {
26+ document . getElementById ( 'pull_id' ) ?. value = id ;
2827
2928 Joomla . submitform ( task ) ;
3029 }
@@ -37,13 +36,7 @@ const PatchTester = {
3736 *
3837 * @param {Event } event
3938 */
40- function patchSubmit ( event ) {
41- const currentTarget = event . currentTarget ;
42- const task = `${ currentTarget . dataset . task } .${ currentTarget . dataset . task } `
43- const id = parseInt ( currentTarget . dataset . id )
44-
45- PatchTester . submitpatch ( task , id ) ;
46- }
39+ const patchSubmit = ( event ) => PatchTester . submitpatch ( `${ event . currentTarget . dataset . task } .${ currentTarget . dataset . task } ` , parseInt ( event . currentTarget . dataset . id ) ) ;
4740
4841
4942document . querySelectorAll ( ".submitPatch" ) . forEach ( ( element ) => element . addEventListener ( "click" , patchSubmit ) ) ;
You can’t perform that action at this time.
0 commit comments