mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-23 05:48:10 -05:00
DRY-ing up setElement() a bit.
This commit is contained in:
@@ -302,7 +302,7 @@
|
||||
}
|
||||
|
||||
options = options ? _.clone(options) : {};
|
||||
if (!this.set(attrs, options)) return false;
|
||||
if (attrs && !this.set(attrs, options)) return false;
|
||||
var model = this;
|
||||
var success = options.success;
|
||||
options.success = function(resp, status, xhr) {
|
||||
@@ -980,9 +980,8 @@
|
||||
},
|
||||
|
||||
setElement : function(element, delegate) {
|
||||
if (_.isString(element)) element = $(element)[0];
|
||||
this.el = element;
|
||||
this.$el = $(element);
|
||||
this.el = this.$el[0];
|
||||
if (delegate !== false) this.delegateEvents();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user