From bb0cc0e62fee8d9af1a649db7a7937737d915c7c Mon Sep 17 00:00:00 2001 From: Lens0021 Date: Fri, 18 Feb 2022 05:14:08 +0900 Subject: [PATCH] Use document.querySelector instead of jquery For some reason, preventDefault() does not work for element for me. Even if it's not true, removing jquery will improve the performance. --- resources/ext.purge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ext.purge.js b/resources/ext.purge.js index d587097..0fe2ed8 100644 --- a/resources/ext.purge.js +++ b/resources/ext.purge.js @@ -1,7 +1,7 @@ mw.loader.using( [ 'mediawiki.api', 'mediawiki.notify' ] ).then( function () { - $( "#ca-purge a" ).on( 'click', function ( e ) { + document.querySelector( '#ca-purge a' ).addEventListener( 'click', function ( e ) { var postArgs = { action: 'purge', titles: mw.config.get( 'wgPageName' ) }; new mw.Api().post( postArgs ).then( function () { location.reload();