Put authorizations into popup

This commit is contained in:
Anna Bodnia
2016-02-23 20:56:09 +02:00
parent 40d3161385
commit 9207be7d4b
12 changed files with 100 additions and 214 deletions

View File

@@ -89,18 +89,9 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
$(this.el).html(Handlebars.templates.main(this.model));
this.model.securityDefinitions = this.model.securityDefinitions || {};
for (name in this.model.securityDefinitions) {
auth = this.model.securityDefinitions[name];
if (auth.type === 'apiKey') {
authEl = new SwaggerUi.Views.ApiKeyButton({model: auth, router: this.router}).render().el;
$('.auth_main_container').append(authEl);
}
if (auth.type === 'basic' && $('.auth_main_container .basic_auth_container').length === 0) {
authEl = new SwaggerUi.Views.BasicAuthButton({model: auth, router: this.router}).render().el;
$('.auth_main_container').append(authEl);
}
if (this.model.securityDefinitions) {
this.authView = new SwaggerUi.Views.AuthView({model: this.model.securityDefinitions});
this.$('.authorize-wrapper').append(this.authView.render().el);
}
// Render each resource