Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pretty tight code uzi man... trimmed a few extra whitespace character…

…s, additional var and single quite to double.
  • Loading branch information...
commit c0a8b9faa5c5e96146830c7bb2771e4aa820c1e6 1 parent 67de61b
docyes authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 Backbone.uriSync.js
12 Backbone.uriSync.js
View
@@ -20,24 +20,24 @@ function uriSync(method, model, options) {
stringify: function(data) {
return encodeURIComponent(JSON.stringify(data));
}
- };
- var data = URI.parse() || {};
+ },
+ data = URI.parse() || {};
switch (method) {
- case "read":
+ case "read":
resp = model.id ? data[model.id] || {} : data;
break;
case "create":
if (!model.id) {
- model.set('id', guid());
+ model.set("id", guid());
}
resp = data[model.id] = model;
window.location.hash = URI.stringify(data);
break;
- case "update":
+ case "update":
resp = data[model.id] = model;
window.location.hash = URI.stringify(data);
break;
- case "delete":
+ case "delete":
delete data[model.id];
window.location.hash = URI.stringify(data);
break;
Please sign in to comment.
Something went wrong with that request. Please try again.