pull out onChange handler for #input_apiKey so it can be called manually
This commit is contained in:
14
dist/index.html
vendored
14
dist/index.html
vendored
@@ -51,14 +51,24 @@
|
||||
sorter : "alpha"
|
||||
});
|
||||
|
||||
$('#input_apiKey').change(function() {
|
||||
function addApiKeyAuthorization() {
|
||||
var key = $('#input_apiKey')[0].value;
|
||||
log("key: " + key);
|
||||
if(key && key.trim() != "") {
|
||||
log("added key " + key);
|
||||
window.authorizations.add("key", new ApiKeyAuthorization("api_key", key, "query"));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$('#input_apiKey').change(function() {
|
||||
addApiKeyAuthorization();
|
||||
});
|
||||
|
||||
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
|
||||
// var apiKey = "myApiKeyXXXX123456789";
|
||||
// $('#input_apiKey').val(apiKey);
|
||||
// addApiKeyAuthorization();
|
||||
|
||||
window.swaggerUi.load();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user