Remove all references to swaggerUi global instance
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
SwaggerUi.Views.StatusCodeView = Backbone.View.extend({
|
||||
initialize: function () {
|
||||
|
||||
initialize: function (opts) {
|
||||
this.options = opts || {};
|
||||
this.router = this.options.router;
|
||||
},
|
||||
|
||||
render: function(){
|
||||
$(this.el).html(Handlebars.templates.status_code(this.model));
|
||||
|
||||
// TODO get rid of "swaggerUi" global dependency
|
||||
if (swaggerUi.api.models.hasOwnProperty(this.model.responseModel)) {
|
||||
if (this.router.api.models.hasOwnProperty(this.model.responseModel)) {
|
||||
var responseModel = {
|
||||
sampleJSON: JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
||||
sampleJSON: JSON.stringify(this.router.api.models[this.model.responseModel].createJSONSample(), null, 2),
|
||||
isParam: false,
|
||||
signature: swaggerUi.api.models[this.model.responseModel].getMockSignature(),
|
||||
signature: this.router.api.models[this.model.responseModel].getMockSignature(),
|
||||
};
|
||||
|
||||
var responseModelView = new SwaggerUi.Views.SignatureView({model: responseModel, tagName: 'div'});
|
||||
|
||||
Reference in New Issue
Block a user