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

@@ -33,7 +33,7 @@ window.SwaggerUi = Backbone.Router.extend({
}
// Create an empty div which contains the dom_id
if (! $('#' + this.dom_id)){
if (! $('#' + this.dom_id).length){
$('body').append('<div id="' + this.dom_id + '"></div>') ;
}
@@ -112,7 +112,8 @@ window.SwaggerUi = Backbone.Router.extend({
this.mainView = new SwaggerUi.Views.MainView({
model: this.api,
el: $('#' + this.dom_id),
swaggerOptions: this.options
swaggerOptions: this.options,
router: this
}).render();
this.showMessage();
switch (this.options.docExpansion) {