Skip to content

Commit

Permalink
Remove the locationType recommendation (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX authored and snewcomer committed Jul 23, 2019
1 parent 695d894 commit 5f8600b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Compatibility
* Ember CLI v2.13 or above


Installation
Installation
------------------------------------------------------------------------------

```
Expand All @@ -50,14 +50,12 @@ const Router = EmberRouter.extend(PageTrackerMixin, RouterScroll, {
});
```

**2.** Update your app's `locationType`
**2.** Enable `historySupportMiddleware` in your app

Edit `config/environment.js` and change `locationType`.
Also add `historySupportMiddleware: true,` to get live-reload working in nested routes.
Edit `config/environment.js` and add `historySupportMiddleware: true,` to get live-reload working in nested routes.
(See [Issue #21](https://github.com/dollarshaveclub/ember-router-scroll/issues/21))

```javascript
locationType: 'router-scroll',
historySupportMiddleware: true,
```

Expand Down Expand Up @@ -240,7 +238,7 @@ Note: if `preserveScrollPosition` is set to true on the service, it will overrid

**1.** Manage preserveScrollPosition via service

When you need to modify `preserveScrollPosition` on the service for a specific transition, you should always reset the value after the transition occurs, otherwise all future transitions will use the same `preserveScrollPosition` value.
When you need to modify `preserveScrollPosition` on the service for a specific transition, you should always reset the value after the transition occurs, otherwise all future transitions will use the same `preserveScrollPosition` value.

Example:

Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="ocean">
<div id="intro">
Click on the submarine to launch!
Click on the submarine to launch!
</div>
{{#link-to "next-page"}}<img src="/images/yellow_submarine.gif" alt="Submarine" id="submarine">{{/link-to}}
<div class="depth left">
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/target.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>
<div id="target-main">
<div id="intro">
Click on the submarine to launch!
Click on the submarine to launch!
</div>
<div class="depth left">
— 500 fathoms
Expand Down
2 changes: 0 additions & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = function(environment) {
modulePrefix: 'dummy',
environment,
rootURL: '/',
locationType: 'router-scroll',
historySupportMiddleware: true,
EmberENV: {
FEATURES: {
Expand Down Expand Up @@ -50,7 +49,6 @@ module.exports = function(environment) {

if (environment === 'production') {
ENV.rootURL = '/ember-router-scroll/';

}

return ENV;
Expand Down

0 comments on commit 5f8600b

Please sign in to comment.