Skip to content

Commit

Permalink
fix return in function
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysbrettbowen committed Mar 7, 2012
1 parent 3a0294f commit 358fff5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sync/ajax.js
Expand Up @@ -30,8 +30,9 @@ mvc.AjaxSync = function(url) {
}
goog.object.extend(this.baseUrls_, goog.object.map(url, function(val) {
if(goog.isString(val))
return function(model) {val.replace(/:(\w+)/g, function(id) {
return model.get(id);
return function(model) {
return val.replace(/:(\w+)/g, function(id) {
return model.get(id);
});};
return val;
}));
Expand All @@ -44,7 +45,7 @@ mvc.AjaxSync = function(url) {
*/
mvc.AjaxSync.prototype.create = function(model, callback) {
this.xhr_.send(""+(this.sendCount_++), this.baseUrls_.create(model),
"POST", model.toJson().toString(), undefined,
"POST", model.toJson().toString(), undefined, undefined,
goog.bind(this.onCreateComplete_, this, model, callback));
};

Expand All @@ -53,7 +54,7 @@ mvc.AjaxSync.prototype.create = function(model, callback) {
*/
mvc.AjaxSync.prototype.read = function(model, callback) {
this.xhr_.send(""+(this.sendCount_++), this.baseUrls_.read(model),
"GET", undefined, undefined,
"GET", undefined, undefined, undefined,
goog.bind(this.onReadComplete_, this, model, callback));
};

Expand All @@ -62,7 +63,7 @@ mvc.AjaxSync.prototype.read = function(model, callback) {
*/
mvc.AjaxSync.prototype.update = function(model, callback) {
this.xhr_.send(""+(this.sendCount_++), this.baseUrls_.update(model),
"PUT", model.toJson().toString(), undefined,
"PUT", model.toJson().toString(), undefined, undefined,
goog.bind(this.onUpdateComplete_, this, model, callback));
};

Expand All @@ -71,7 +72,7 @@ mvc.AjaxSync.prototype.update = function(model, callback) {
*/
mvc.AjaxSync.prototype.del = function(model, callback) {
this.xhr_.send(""+(this.sendCount_++), this.baseUrls_.del(model),
"DELETE", undefined, undefined,
"DELETE", undefined, undefined, undefined,
goog.bind(this.onDelComplete_, this, model, callback));
};

Expand Down

0 comments on commit 358fff5

Please sign in to comment.