Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable scroll element #67

Merged
merged 2 commits into from
Aug 9, 2017
Merged

configurable scroll element #67

merged 2 commits into from
Aug 9, 2017

Conversation

sebastianhelbig
Copy link
Contributor

Makes the scrolled element configurable. Should propably solve #56

README.md Outdated
@@ -10,6 +10,15 @@
ember install ember-router-scroll
```

### Options
You can specify the id of an element for which the scroll position is saved and set. Default is `window` for using the scroll position of the whole viewport. You can pass an options object in your applications `config/environment.js` file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application's config/environment.js

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktrhn can you put in an apostrophe in the word "application"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

addon/index.js Outdated
window.scrollTo(scrollPosition.x, scrollPosition.y);
if ('window' === scrollElement) {
window.scrollTo(scrollPosition.x, scrollPosition.y);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line.

if ('window' === scrollElement) {
x = window.scrollX;
y = window.scrollY;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line.

@briangonzalez briangonzalez merged commit 2d577cd into DockYard:master Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants