Skip to content

Commit 641beab

Browse files
committed
Merge branch 'master' of https://github.com/wll8/redoc-try
2 parents 225b3f2 + c460ed9 commit 641beab

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

dist/try.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
105105
}
106106
function initCss() {
107107
// reset swagger-ui css
108-
$('head').append("\n <style>\n /* Set the position of swaggerBox with body as the relative element */\n body {\n position: relative;\n }\n @media print, screen and (max-width: 85rem) {\n .eIeJha,\n .dtUibw {\n padding: 4px;\n }\n }\n\n .swaggerBox.hide {\n visibility: hidden;\n cursor: none;\n width: 0;\n height: 0;\n }\n .swaggerBox.show {\n visibility: visible;\n cursor: initial;\n }\n\n /* Reset the style of swagger-ui */\n .swaggerBox .swagger-ui .wrapper {\n padding: 0;\n }\n .swaggerBox .swagger-ui .download-contents {\n top: -10px;\n right: 0;\n width: initial;\n }\n\n /* Disable api bar to avoid problems */\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-summary {\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Disable the api bar, but exclude the authorization button */\n .swaggerBox .swagger-ui .authorization__btn {\n cursor: initial;\n pointer-events: initial;\n }\n\n .swaggerBox {\n border-radius: 4px;\n background-color: #fff;\n width: 100%;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n }\n .swaggerBox:not(.onlySwagger) {\n overflow: hidden;\n }\n /* Hide some disturbing elements */\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary {\n visibility: hidden;\n padding: 0;\n }\n .swaggerBox.pure:not(.onlySwagger) .opblock-section thead,\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary * {\n display: none;\n }\n\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-section-header,\n .swaggerBox:not(.onlySwagger) .btn.cancel,\n .swaggerBox:not(.onlySwagger) .try-out,\n .swaggerBox:not(.onlySwagger) .responses-inner>div>h4,\n .swaggerBox:not(.onlySwagger) :not(.live-responses-table).responses-table,\n .swaggerBox:not(.onlySwagger) .opblock-body > .opblock-description-wrapper {\n display: none;\n }\n\n .swaggerBox .tryBtn {\n margin-right: 10px;\n background-color: #fff;\n }\n </style>\n ");
108+
$('head').append("\n <style>\n /* Set the position of swaggerBox with body as the relative element */\n body {\n position: relative;\n }\n @media print, screen and (max-width: 85rem) {\n .eIeJha,\n .dtUibw {\n padding: 4px;\n }\n }\n\n .swaggerBox.hide {\n visibility: hidden;\n cursor: none;\n width: 0;\n height: 0;\n }\n .swaggerBox.show {\n visibility: visible;\n cursor: initial;\n }\n\n /* Reset the style of swagger-ui */\n .swaggerBox .swagger-ui .wrapper {\n padding: 0;\n }\n .swaggerBox .swagger-ui .download-contents {\n top: -10px;\n right: 0;\n width: initial;\n }\n\n /* Disable api bar to avoid problems */\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-summary {\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Disable the api bar, but exclude the authorization button */\n .swaggerBox .swagger-ui .authorization__btn {\n cursor: initial;\n pointer-events: initial;\n }\n\n .swaggerBox {\n border-radius: 4px;\n background-color: #fff;\n width: 100%;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n }\n .swaggerBox:not(.onlySwagger) {\n overflow: hidden;\n }\n /* Hide some disturbing elements */\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary {\n visibility: hidden;\n padding: 0;\n }\n .swaggerBox.pure:not(.onlySwagger) .opblock-section thead,\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary * {\n display: none;\n }\n\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-section-header,\n .swaggerBox:not(.onlySwagger) .btn.cancel,\n .swaggerBox:not(.onlySwagger) .try-out,\n .swaggerBox:not(.onlySwagger) .responses-inner>div>h4,\n .swaggerBox:not(.onlySwagger) :not(.live-responses-table).responses-table,\n .swaggerBox:not(.onlySwagger) .opblock-body > .opblock-description-wrapper {\n display: none;\n }\n .swaggerBox:not(.onlySwagger) .block div>span:last-child .operation-tag-content>span:last-child {\n display: block;\n margin-bottom: 100vh;\n }\n .swaggerBox .tryBtn {\n margin-right: 10px;\n background-color: #fff;\n }\n </style>\n ");
109109
}
110110
function initSwagger(swaggerOptions) {
111111
// dom

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
!window.initTryOptions.openApi && (delete window.initTryOptions.openApi);
2424
</script>
2525
<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.min.js"> </script>
26-
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].2/dist/try.js"></script>
26+
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].3/dist/try.js"></script>
2727
<script>
2828
// initTry(`https://petstore.swagger.io/v2/swagger.json`)
2929
initTry({

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Add `Try it out` function like [swagger](https://petstore.swagger.io/) on [redoc
1414
<body>
1515
<div id="redoc-container"></div>
1616
<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.min.js"> </script>
17-
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].2/dist/try.js"></script>
17+
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].3/dist/try.js"></script>
1818
<script>
1919
// initTry(`https://petstore.swagger.io/v2/swagger.json`)
2020
initTry({

try.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ function initCss() {
158158
.swaggerBox:not(.onlySwagger) .opblock-body > .opblock-description-wrapper {
159159
display: none;
160160
}
161-
161+
.swaggerBox:not(.onlySwagger) .block div>span:last-child .operation-tag-content>span:last-child {
162+
display: block;
163+
margin-bottom: 100vh;
164+
}
162165
.swaggerBox .tryBtn {
163166
margin-right: 10px;
164167
background-color: #fff;

0 commit comments

Comments
 (0)