diff --git a/source/wp-content/themes/wporg-developer-2023/js/user-notes-voting.js b/source/wp-content/themes/wporg-developer-2023/js/user-notes-voting.js index 79f13bcf..f2fe95f5 100644 --- a/source/wp-content/themes/wporg-developer-2023/js/user-notes-voting.js +++ b/source/wp-content/themes/wporg-developer-2023/js/user-notes-voting.js @@ -1,26 +1,24 @@ /** * Dynamic functionality for voting on user submitted notes. * - * @param $ - * @param wp */ -( function ( $, wp ) { - $( '.comment-list' ).on( 'click', 'a.user-note-voting-up, a.user-note-voting-down', function ( event ) { +( function( $, wp ) { + $( '.comment-list' ).on( 'click', 'a.user-note-voting-up, a.user-note-voting-down', function( event ) { event.preventDefault(); - const $item = $( this ), + var $item = $( this ), comment = $item.closest( '.comment' ); $.post( wporg_note_voting.ajaxurl, { - action: 'note_vote', - comment: $item.attr( 'data-id' ), - vote: $item.attr( 'data-vote' ), - _wpnonce: $item.parent().attr( 'data-nonce' ), + action: 'note_vote', + comment: $item.attr( 'data-id' ), + vote: $item.attr( 'data-vote' ), + _wpnonce: $item.parent().attr( 'data-nonce' ) }, - function ( data ) { + function( data ) { if ( '0' !== data ) { $item.closest( '.user-note-voting' ).replaceWith( data ); wp.a11y.speak( $( '.user-note-voting-count', comment ).text() );