mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
code style tweak
This commit is contained in:
28
backbone.js
28
backbone.js
@@ -236,6 +236,20 @@
|
||||
return value;
|
||||
},
|
||||
|
||||
// Return a copy of the model's attributes.
|
||||
attributes : function() {
|
||||
return _.clone(this._attributes);
|
||||
},
|
||||
|
||||
// Bind all methods in the list to the model.
|
||||
bindAll : function() {
|
||||
_.bindAll.apply(_, [this].concat(arguments));
|
||||
},
|
||||
|
||||
toString : function() {
|
||||
return 'Model ' + this.id;
|
||||
},
|
||||
|
||||
// Set a hash of model attributes, and sync the model to the server.
|
||||
save : function(attrs, options) {
|
||||
if (!this.resource) throw new Error(this.toString() + " cannot be saved without a resource.");
|
||||
@@ -255,20 +269,6 @@
|
||||
});
|
||||
},
|
||||
|
||||
// Return a copy of the model's attributes.
|
||||
attributes : function() {
|
||||
return _.clone(this._attributes);
|
||||
},
|
||||
|
||||
// Bind all methods in the list to the model.
|
||||
bindAll : function() {
|
||||
_.bindAll.apply(_, [this].concat(arguments));
|
||||
},
|
||||
|
||||
toString : function() {
|
||||
return 'Model ' + this.id;
|
||||
},
|
||||
|
||||
// Destroy this model on the server.
|
||||
destroy : function(options) {
|
||||
if (this.collection) this.collection.remove(this);
|
||||
|
||||
Reference in New Issue
Block a user