Skip to content

Commit

Permalink
Set current window location scheme if available
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop committed Dec 6, 2019
1 parent 88bb89e commit 8b6f52c
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 8b6f52c

Please sign in to comment.