Skip to content

Mixin for resetting the browser window scroll position on route transitions

License

Notifications You must be signed in to change notification settings

davewasmer/ember-cli-reset-scroll

Repository files navigation

ember-cli-reset-scroll

Resets the browser window scroll position when a route transitions:

import Ember from 'ember';
import ResetScrollMixin from 'ember-cli-reset-scroll';

export default Ember.Route.extend(ResetScrollMixin, {

  // Scrolls to top
  resetScroll: undefined

  // Scroll to a specific position (in px)
  resetScroll: 20

  // Scroll to a specific position based on the route name (in px)
  resetScroll: {
    'books.index': 30,
    'authors.*': 210
  }

});

About

Mixin for resetting the browser window scroll position on route transitions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published