Remove global references to swaggerUi object

By passing parent view as an option to child views, child views can
access parent views and eventually can access model of MainView

There is alos a new domEl option available for SwaggerUI constructor.
User can send domEl instead of dom_id to specifiy which element they
want to render to
This commit is contained in:
Mohsen Azimi
2015-03-10 00:48:56 -07:00
parent ff5eb6f0f4
commit 7006e86fa5
8 changed files with 96 additions and 57 deletions

View File

@@ -57,7 +57,7 @@ function coffeescript () {
return gulp
.src(['./src/main/coffeescript/**/*.coffee'])
.pipe(coffee({bare: true}))
.on('error', gutil.log);
.on('error', log);
}
/**
@@ -93,7 +93,7 @@ gulp.task('less', ['clean'], function() {
'./src/main/less/reset.less'
])
.pipe(less())
.on('error', gutil.log)
.on('error', log)
.pipe(gulp.dest('./src/main/html/css/'))
.pipe(connect.reload());
});
@@ -108,20 +108,20 @@ gulp.task('copy', ['less'], function() {
gulp
.src(['./lib/**/*.{js,map}'])
.pipe(gulp.dest('./dist/lib'))
.on('error', gutil.log)
.on('error', log)
// copy all files inside html folder
gulp
.src(['./src/main/html/**/*'])
.pipe(gulp.dest('./dist'))
.on('error', gutil.log)
.on('error', log)
});
/**
* Watch for changes and recompile
*/
gulp.task('watch', function() {
return watch(['./src/**/*.{coffee,js,less,handlebars}'], function() {
return watch(['./src/**/*.{coffee,js,less,handlebars,html}'], function() {
gulp.start('default');
});
});
@@ -136,6 +136,10 @@ gulp.task('connect', function() {
});
});
function log(error) {
console.log(error.toString());
}
gulp.task('default', ['dist', 'copy']);
gulp.task('serve', ['connect', 'watch'])
gulp.task('serve', ['connect', 'watch', 'default'])