Pass router to all views

This commit is contained in:
Mohsen Azimi
2015-03-16 11:08:28 -07:00
parent 194f2d5fb5
commit 9ed1ad88ec
6 changed files with 32 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
SwaggerUi.Views.ResourceView = Backbone.View.extend({
initialize: function(opts) {
opts = opts || {};
this.router = opts.router;
this.auths = opts.auths;
if ('' === this.model.description) {
this.model.description = null;
@@ -50,6 +51,7 @@ SwaggerUi.Views.ResourceView = Backbone.View.extend({
// Render an operation and add it to operations li
var operationView = new SwaggerUi.Views.OperationView({
model: operation,
router: this.router,
tagName: 'li',
className: 'endpoint',
swaggerOptions: this.options.swaggerOptions,