瀏覽代碼

pull out onChange handler for #input_apiKey so it can be called manually

bubble
Alex Agranov 10 年之前
父節點
當前提交
ad3e9e5481
共有 1 個檔案被更改,包括 17 行新增7 行删除
  1. +17
    -7
      dist/index.html

+ 17
- 7
dist/index.html 查看文件

@@ -51,14 +51,24 @@
sorter : "alpha"
});
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() {
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"));
}
})
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>


Loading…
取消
儲存