Skip to content

Commit

Permalink
Merge pull request #135 from PolymerElements/scroll
Browse files Browse the repository at this point in the history
Misc fixes.
  • Loading branch information
aomarks authored Jun 14, 2017
2 parents 5506d32 + af3939d commit c41b50a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ By default it uses the URL fragment for routing (e.g.
static file hosts.

To use the real URL path for routing, set the `base-href` property to the
server mount point (e.g. `/` or `/docs/`). Note that this requires a host that
serves the application from all paths that should be handled by the doc viewer.
server mount point (e.g. `/api/docs` or *empty string* for the root path). Note
that this requires a host that serves the application from all paths that
should be handled by the doc viewer.

### Previous versions

Expand Down
18 changes: 13 additions & 5 deletions iron-component-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
background-color: #5a5a5a;
}

[drawer-toggle] {
flex-shrink: 0;
}

[condensed-title] {
white-space: nowrap;
}
Expand Down Expand Up @@ -99,6 +103,7 @@
<app-drawer id="drawer" slot="drawer" swipe-open>
<iron-doc-nav
descriptor="[[_descriptor]]"
base-href="[[baseHref]]"
path="[[_path]]"
on-select="_onNavSelect">
</iron-doc-nav>
Expand All @@ -119,6 +124,7 @@

<div id="scroller">
<iron-doc-viewer
id="viewer"
descriptor="[[_descriptor]]"
base-href="[[baseHref]]"
demo-src-prefix="[[demoSrcPrefix]]"
Expand Down Expand Up @@ -148,10 +154,12 @@

/**
* By default all routing is performed using the URL fragment
* (e.g. `docs.html#/elements/my-element`). If your server supports
* it and you would like to use the real URL path instead (e.g.
* `/docs/elements/my-element`), set this to the base path where the
* page is mounted (e.g. `/` or `/docs/`).
* (e.g. `docs.html#/elements/my-element`).
*
* If your server supports it and you would like to use the real URL
* path instead (e.g. `/api/docs/elements/my-element`), set this to
* the base path where the page is mounted, omitting the trailing
* slash (e.g. `/api/docs` or *empty string* for the root path).
*/
baseHref: String,

Expand Down Expand Up @@ -183,7 +191,7 @@
// Note we need to listen for this event, and can't rely just on the
// path changing, because the user might click on the nav item they
// are already viewing.
window.document.body.scrollTop = 0;
this.$.viewer.scrollIntoView();
if (this._narrow) {
this.$.drawer.close();
}
Expand Down

0 comments on commit c41b50a

Please sign in to comment.