Skip to content

Commit

Permalink
Resolves #559
Browse files Browse the repository at this point in the history
Adds .comment_highlighting class after scrolling to comment.
  • Loading branch information
lalentine96 authored and umputun committed Apr 12, 2020
1 parent 2e47fde commit 49dd5bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@
}
}
}

&.comment_highlighting {
background: var(--color19);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@
}
}
}

&.comment_highlighting {
background: var(--color4);
}
}
4 changes: 4 additions & 0 deletions frontend/app/components/root/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export class Root extends Component<Props, State> {
if (comment) {
setTimeout(() => {
postMessage({ scrollTo: comment.getBoundingClientRect().top });
comment.classList.add('comment_highlighting');
setTimeout(() => {
comment.classList.remove('comment_highlighting');
}, 5e3);
}, 500);
}
}
Expand Down

0 comments on commit 49dd5bd

Please sign in to comment.