Skip to content

Commit

Permalink
Merge pull request #7 from swaggest/location-scheme
Browse files Browse the repository at this point in the history
Set current window location scheme if available
  • Loading branch information
vearutop authored Dec 6, 2019
2 parents 88bb89e + 8b6f52c commit 9732763
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion v3/index.tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ var indexTpl = `
layout: "StandaloneLayout",
showExtensions: true,
showCommonExtensions: true,
validatorUrl: null
validatorUrl: null,
onComplete: function() {
var dom = document.querySelector('.scheme-container select');
for (var key in dom) {
if (key.startsWith("__reactInternalInstance$")) {
var compInternals = dom[key]._currentElement;
var compWrapper = compInternals._owner;
compWrapper._instance.setScheme(window.location.protocol.slice(0,-1));
}
}
}
};
if (cfg.preAuthorizeApiKey) {
Expand Down

0 comments on commit 9732763

Please sign in to comment.