Skip to content

Commit

Permalink
feat: Avoid swagger being overwritten by callback functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
wll8 committed Jun 29, 2020
1 parent d31d0c4 commit bed8d39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/try.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ function cfgHandle(userCfg) {
}, userCfg.swaggerOptions),
redocOptions: [redoc_openApi || userCfg.openApi || testOpenApi, redoc_options || {
enableConsole: true
}, redoc_dom || document.getElementById('redoc-container'), redoc_callBack || function () {
}, redoc_dom || document.getElementById('redoc-container'), function () {
redoc_callBack();
initSwagger(cfg.swaggerOptions);
$(".swaggerBox").addClass("hide");
}]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redoc-try",
"version": "1.3.1",
"version": "1.3.2",
"description": "[👉 online preview](https://wll8.github.io/redoc-try/index.html)",
"main": "try.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion try.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function cfgHandle(userCfg) {
redoc_openApi || userCfg.openApi || testOpenApi,
redoc_options || {enableConsole: true},
redoc_dom || document.getElementById('redoc-container'),
redoc_callBack || function () {
() => {
redoc_callBack()
initSwagger(cfg.swaggerOptions)
$(`.swaggerBox`).addClass(`hide`)
},
Expand Down

0 comments on commit bed8d39

Please sign in to comment.