From 305b81023f3f19c330ef07f388ce435d5bdf760d Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+cbravobernal@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:54:16 +0200 Subject: [PATCH] Remove jquery code --- .../wporg-developer-2023/js/user-notes.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/source/wp-content/themes/wporg-developer-2023/js/user-notes.js b/source/wp-content/themes/wporg-developer-2023/js/user-notes.js index dca3ce18..9554d20e 100644 --- a/source/wp-content/themes/wporg-developer-2023/js/user-notes.js +++ b/source/wp-content/themes/wporg-developer-2023/js/user-notes.js @@ -31,7 +31,7 @@ if ( ! comment.length ) { return; } - + console.log( 'patata' ); // Scroll to top level comment and adjust for admin bar. const pos = comment.getBoundingClientRect(); window.scrollTo( { @@ -40,19 +40,6 @@ } ); } ); - // Scroll to comment if comment date link is clicked - $( '#comments' ).on( 'click', '.comment-date', function ( e ) { - // Scroll to comment and adjust for admin bar - // Add 16px for child comments - const pos = $( this ).offset(); - $( 'html,body' ).animate( - { - scrollTop: pos.top - wpAdminBar - 16, - }, - 1 - ); - } ); - // Scroll to comment if comment date link is clicked. document.querySelectorAll( '#comments .comment-date' ).forEach( ( element ) => { element.addEventListener( 'click', function () { @@ -64,6 +51,7 @@ top: offsetTop - wpAdminBar - 16, behavior: 'smooth', } ); + console.log( 'patata' ); } ); } ); @@ -72,7 +60,7 @@ if ( target ) { const pos = target.getBoundingClientRect(); const offsetTop = pos.top + window.scrollY; - + console.log( 'patata' ); window.scrollTo( { top: offsetTop - wpAdminBar, behavior: 'smooth', @@ -90,6 +78,7 @@ element.addEventListener( 'click', function ( e ) { e.preventDefault(); showCommentForm(); + console.log( 'patata' ); } ); } );