Skip to content

Commit 7693dfe

Browse files
authored
Merge pull request #4036 from shockey/v/3.7.0
v3.7.0
2 parents d0ffb2b + 7faf79a commit 7693dfe

File tree

10 files changed

+43
-31
lines changed

10 files changed

+43
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
2222

2323
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
2424
------------------ | ------------ | -------------------------- | -----
25-
3.6.1 | 2017-12-01 | 2.0, 3.0 | [tag v3.6.1](https://github.com/swagger-api/swagger-ui/tree/v3.6.1)
25+
3.7.0 | 2017-12-15 | 2.0, 3.0 | [tag v3.7.0](https://github.com/swagger-api/swagger-ui/tree/v3.7.0)
2626
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2727
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2828
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)

dist/swagger-ui-bundle.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-standalone-preset.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-ui",
3-
"version": "3.6.1",
3+
"version": "3.7.0",
44
"main": "dist/swagger-ui.js",
55
"repository": "[email protected]:swagger-api/swagger-ui.git",
66
"contributors": [
@@ -81,7 +81,7 @@
8181
"scroll-to-element": "^2.0.0",
8282
"serialize-error": "2.0.0",
8383
"shallowequal": "0.2.2",
84-
"swagger-client": "^3.4.1",
84+
"swagger-client": "^3.4.2",
8585
"url-parse": "^1.1.8",
8686
"whatwg-fetch": "0.11.1",
8787
"worker-loader": "^0.7.1",

src/core/plugins/deep-linking/spec-wrap-actions.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,32 @@ export const updateResolved = (ori, { layoutActions, getConfigs }) => (...args)
3131
let swaggerUI = document.querySelector(".swagger-ui")
3232
let myScroller = zenscroll.createScroller(swaggerUI)
3333

34+
let target
35+
3436
if(tag && operationId) {
3537
// Pre-expand and scroll to the operation
3638
layoutActions.show(["operations-tag", tag], true)
3739
layoutActions.show(["operations", tag, operationId], true)
3840

39-
let target = document.getElementById(`operations-${escapeDeepLinkPath(tag)}-${escapeDeepLinkPath(operationId)}`)
40-
myScroller.to(target)
41-
41+
target = document
42+
.getElementById(`operations-${escapeDeepLinkPath(tag)}-${escapeDeepLinkPath(operationId)}`)
4243
} else if(tag) {
4344
// Pre-expand and scroll to the tag
4445
layoutActions.show(["operations-tag", tag], true)
4546

46-
let target = document.getElementById(`operations-tag-${escapeDeepLinkPath(tag)}`)
47+
target = document.getElementById(`operations-tag-${escapeDeepLinkPath(tag)}`)
48+
}
49+
50+
51+
if(target) {
4752
myScroller.to(target)
53+
setTimeout(() => {
54+
// Backup functionality: if we're still at the top of the document,
55+
// scroll on the entire page (not within the Swagger-UI container)
56+
if(zenscroll.getY() === 0) {
57+
zenscroll.to(target)
58+
}
59+
}, 50)
4860
}
4961
}
5062

0 commit comments

Comments
 (0)