Skip to content

Commit

Permalink
Merge pull request #1718 from rtCamp/fix/comment-box
Browse files Browse the repository at this point in the history
Remove redundant DOM queries
  • Loading branch information
vaishaliagola27 committed Dec 29, 2020
2 parents 35492eb + 26ef594 commit 23153cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/assets/js/rtMedia.backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,9 @@ function rtmedia_disable_popup_navigation( $selector ){
*/
const rtMediaScrollComments = () => {
const commentBox = document.getElementById( 'rtmedia_comment_ul' );
const commentsToScroll = ( document.getElementById('rtmedia_comment_ul' ).offsetHeight ) * 1000;
commentBox.scrollTo( { top: commentsToScroll, behavior: 'smooth' } );

if ( commentBox !== null ) {
const commentsToScroll = ( commentBox.offsetHeight ) * 1000;
commentBox.scrollTo( { top: commentsToScroll, behavior: 'smooth' } );
}
}

0 comments on commit 23153cb

Please sign in to comment.