Skip to content

Commit cb8505d

Browse files
committed
fixed 'scrollToPath()' documentation and example
1 parent e7c13e1 commit cb8505d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

docs/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ <h2> Methods </h2>
714714
<td> <a href="https://github.com/rapi-doc/RapiDoc/blob/master/docs/examples/example9.html"> Example </a></td>
715715
</tr>
716716
<tr id="scrollTo">
717-
<td class="mono bold right">scrollTo(path) </td>
717+
<td class="mono bold right">scrollToPath(path) </td>
718718
<td class="gray" colspan="2">
719719
To programmatically scroll to a section (identified by combination method and path).
720720
<br/>

docs/examples/collapsable-focused.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,36 @@
1818

1919
function scrollWithAPI() {
2020
let docEl = getRapiDoc();
21-
docEl.scrollTo("get-/closed");
21+
docEl.scrollToPath("get-/closed");
2222
}
2323
</script>
2424

2525
<meta charset="utf-8">
2626
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
2727
<script type="text/javascript" src="../rapidoc-min.js"></script>
28-
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet">
2928
<link href='../index.css' rel='stylesheet'>
3029
</head>
3130
<body>
3231
<rapi-doc
3332
id="thedoc"
3433
spec-url="../specs/collapsable.yaml"
3534
show-header = "false"
36-
mono-font = "Roboto Mono"
37-
regular-font = 'Open Sans'
35+
allow-authentication = "false"
36+
allow-server-selection = "false"
37+
show-info = "true"
3838
render-style= "focused"
3939
>
40-
4140
<div style="padding:16px; display: flex;justify-content: center; align-items: center;">
42-
<span>Use</span> <span class='mono' style="margin: 0 5px;">scrollTo()</span> <span> method to goto : </span>
43-
<button class="btn normal" onclick="document.getElementById('thedoc').scrollTo('overview')">
41+
<span>Use</span> <span class='mono' style="margin: 0 5px;">scrollToPath(path:string)</span> <span> method to goto : </span>
42+
</div>
43+
<div style="padding:16px; display: flex;justify-content: center; align-items: center;">
44+
<button class="btn normal" onclick="document.getElementById('thedoc').scrollToPath('overview')">
4445
Overview
4546
</button>
46-
<button class="btn normal" style="width:190px" onclick="document.getElementById('thedoc').scrollTo('get-/path1-in-closed-tag')">
47+
<button class="btn normal" style="width:190px" onclick="document.getElementById('thedoc').scrollToPath('get-/path1-in-closed-tag')">
4748
valid path (in collapsed tag)
4849
</button>
49-
<button class="btn normal" style="width:140px" onclick="document.getElementById('thedoc').scrollTo('an-incorrect-path')">
50+
<button class="btn normal" style="width:140px" onclick="document.getElementById('thedoc').scrollToPath('an-incorrect-path')">
5051
non-existant path
5152
</button>
5253
</div>

0 commit comments

Comments
 (0)