updated library

This commit is contained in:
Tony Tam
2014-09-27 22:59:19 -07:00
parent b7a452eca3
commit cbead84f8e
2 changed files with 28 additions and 6 deletions

View File

@@ -206,6 +206,8 @@ var SwaggerClient = function(url, options) {
this.failure = options.failure != null ? options.failure : function() {}; this.failure = options.failure != null ? options.failure : function() {};
this.progress = options.progress != null ? options.progress : function() {}; this.progress = options.progress != null ? options.progress : function() {};
this.spec = options.spec;
if (options.success != null) if (options.success != null)
this.build(); this.build();
} }
@@ -247,9 +249,18 @@ SwaggerClient.prototype.build = function() {
} }
} }
}; };
if(this.spec) {
var self = this;
setTimeout(function() {
self.buildFromSpec(self.spec);
}, 10);
}
else {
var e = (typeof window !== 'undefined' ? window : exports); var e = (typeof window !== 'undefined' ? window : exports);
var status = e.authorizations.apply(obj); var status = e.authorizations.apply(obj);
new SwaggerHttp().execute(obj); new SwaggerHttp().execute(obj);
}
return this; return this;
}; };

View File

@@ -206,6 +206,8 @@ var SwaggerClient = function(url, options) {
this.failure = options.failure != null ? options.failure : function() {}; this.failure = options.failure != null ? options.failure : function() {};
this.progress = options.progress != null ? options.progress : function() {}; this.progress = options.progress != null ? options.progress : function() {};
this.spec = options.spec;
if (options.success != null) if (options.success != null)
this.build(); this.build();
} }
@@ -247,9 +249,18 @@ SwaggerClient.prototype.build = function() {
} }
} }
}; };
if(this.spec) {
var self = this;
setTimeout(function() {
self.buildFromSpec(self.spec);
}, 10);
}
else {
var e = (typeof window !== 'undefined' ? window : exports); var e = (typeof window !== 'undefined' ? window : exports);
var status = e.authorizations.apply(obj); var status = e.authorizations.apply(obj);
new SwaggerHttp().execute(obj); new SwaggerHttp().execute(obj);
}
return this; return this;
}; };