Skip to content

Commit c41b50a

Browse files
authored
Merge pull request #135 from PolymerElements/scroll
Misc fixes.
2 parents 5506d32 + af3939d commit c41b50a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ By default it uses the URL fragment for routing (e.g.
7575
static file hosts.
7676

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

8182
### Previous versions
8283

iron-component-page.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
background-color: #5a5a5a;
3737
}
3838

39+
[drawer-toggle] {
40+
flex-shrink: 0;
41+
}
42+
3943
[condensed-title] {
4044
white-space: nowrap;
4145
}
@@ -99,6 +103,7 @@
99103
<app-drawer id="drawer" slot="drawer" swipe-open>
100104
<iron-doc-nav
101105
descriptor="[[_descriptor]]"
106+
base-href="[[baseHref]]"
102107
path="[[_path]]"
103108
on-select="_onNavSelect">
104109
</iron-doc-nav>
@@ -119,6 +124,7 @@
119124

120125
<div id="scroller">
121126
<iron-doc-viewer
127+
id="viewer"
122128
descriptor="[[_descriptor]]"
123129
base-href="[[baseHref]]"
124130
demo-src-prefix="[[demoSrcPrefix]]"
@@ -148,10 +154,12 @@
148154

149155
/**
150156
* By default all routing is performed using the URL fragment
151-
* (e.g. `docs.html#/elements/my-element`). If your server supports
152-
* it and you would like to use the real URL path instead (e.g.
153-
* `/docs/elements/my-element`), set this to the base path where the
154-
* page is mounted (e.g. `/` or `/docs/`).
157+
* (e.g. `docs.html#/elements/my-element`).
158+
*
159+
* If your server supports it and you would like to use the real URL
160+
* path instead (e.g. `/api/docs/elements/my-element`), set this to
161+
* the base path where the page is mounted, omitting the trailing
162+
* slash (e.g. `/api/docs` or *empty string* for the root path).
155163
*/
156164
baseHref: String,
157165

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

0 commit comments

Comments
 (0)