Skip to content

Commit

Permalink
Remove jquery code
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Jul 23, 2024
1 parent 96e4f24 commit 305b810
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions source/wp-content/themes/wporg-developer-2023/js/user-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( {
Expand All @@ -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 () {
Expand All @@ -64,6 +51,7 @@
top: offsetTop - wpAdminBar - 16,
behavior: 'smooth',
} );
console.log( 'patata' );
} );
} );

Expand All @@ -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',
Expand All @@ -90,6 +78,7 @@
element.addEventListener( 'click', function ( e ) {
e.preventDefault();
showCommentForm();
console.log( 'patata' );
} );
} );

Expand Down

0 comments on commit 305b810

Please sign in to comment.