Remove all references to swaggerUi global instance

This commit is contained in:
Mohsen Azimi
2015-03-16 13:52:38 -07:00
parent 79d9d1cf0d
commit 51bbbf03db
7 changed files with 53 additions and 35 deletions

View File

@@ -7,7 +7,10 @@ SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to gl
'click #apply_api_key' : 'applyApiKey'
},
initialize: function(){},
initialize: function(opts){
this.options = opts || {};
this.router = this.options.router;
},
render: function(){
var template = this.template();
@@ -23,13 +26,13 @@ SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to gl
$('#input_apiKey_entry').val(),
this.model.in
);
window.authorizations.add(this.model.name, keyAuth);
window.swaggerUi.load();
this.router.api.clientAuthorizations.add(this.model.name, keyAuth);
this.router.load();
$('#apikey_container').show();
},
toggleApiKeyContainer: function(){
if ($('#apikey_container').length > 0) {
if ($('#apikey_container').length) {
var elem = $('#apikey_container').first();