Skip to content

Commit

Permalink
Resolves umputun#559
Browse files Browse the repository at this point in the history
Adds .comment_highlighting class after scrolling to comment.
  • Loading branch information
lalentine96 committed Apr 11, 2020
1 parent c76117d commit 68b6c82
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 68b6c82

Please sign in to comment.