Skip to content

Commit 40fd482

Browse files
committed
Removed debugging and properly check for console
1 parent eac3dc4 commit 40fd482

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/views/grape_swagger_rails/application/index.html.erb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
headers: options.headers,
1717
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
1818
onComplete: function(swaggerApi, swaggerUi){
19-
if(console) {
19+
if('console' in window) {
2020
console.log("Loaded SwaggerUI")
2121
console.log(swaggerApi);
2222
console.log(swaggerUi);
2323
}
2424
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
2525
},
2626
onFailure: function(data) {
27-
if(console) {
27+
if('console' in window) {
2828
console.log("Unable to Load SwaggerUI");
2929
console.log(data);
3030
}
@@ -34,12 +34,11 @@
3434

3535
$('#input_apiKey').change(function() {
3636
var key = $('#input_apiKey')[0].value;
37-
console.log("key: " + key);
37+
3838
if(key && key.trim() != "") {
3939
if (options.api_auth == 'basic') {
4040
key = "Basic " + Base64.encode(key);
4141
}
42-
console.log("added key " + key);
4342
window.authorizations.add("key", new ApiKeyAuthorization(options.api_key_name, key, options.api_key_type));
4443
} else {
4544
window.authorizations.add("key", null);

0 commit comments

Comments
 (0)