Skip to content
Snippets Groups Projects
Commit 69f17da5 authored by Chris Lawton's avatar Chris Lawton Committed by Todd Dembrey
Browse files

only show the scroll top top of activity feed button when the user has scroll...

only show the scroll top top of activity feed button when the user has scroll passed the top of the window
parent 81d93065
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,11 @@ import Tabs from './components/tabs'; ...@@ -50,6 +50,11 @@ import Tabs from './components/tabs';
$('.js-activity-feed').removeClass('is-open'); $('.js-activity-feed').removeClass('is-open');
}); });
// Show scroll to top of activity feed button on scroll
$('.js-activity-feed').on('scroll', function() {
$(this).scrollTop() === 0 ? $('.js-to-top').removeClass('is-visible') : $('.js-to-top').addClass('is-visible');
});
// Scroll to the top of the activity feed // Scroll to the top of the activity feed
$('.js-to-top').click(() => $('.js-activity-feed').animate({ scrollTop: 0 }, 250)); $('.js-to-top').click(() => $('.js-activity-feed').animate({ scrollTop: 0 }, 250));
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment