Update vendors.

Former-commit-id: b239f365c9d8e012bf20525167e6d1a412ce828e
This commit is contained in:
John-David Dalton
2012-08-12 21:57:09 -07:00
parent be4f81f584
commit 23ff403529
9 changed files with 238 additions and 123 deletions

View File

@@ -1290,8 +1290,8 @@
_ensureElement: function() {
if (!this.el) {
var attrs = _.extend({}, getValue(this, 'attributes'));
if (this.id) attrs.id = this.id;
if (this.className) attrs['class'] = this.className;
if (this.id) attrs.id = getValue(this, 'id');
if (this.className) attrs['class'] = getValue(this, 'className');
this.setElement(this.make(getValue(this, 'tagName'), attrs), false);
} else {
this.setElement(this.el, false);

View File

@@ -135,6 +135,20 @@ $(document).ready(function() {
ok(!view.el);
});
test("View: with className and id functions", 2, function() {
var View = Backbone.View.extend({
className: function() {
return 'className';
},
id: function() {
return 'id';
}
});
var view = new View();
strictEqual(view.el.className, 'className');
strictEqual(view.el.id, 'id');
});
test("View: with attributes", 2, function() {
var view = new Backbone.View({attributes : {'class': 'one', id: 'two'}});
equal(view.el.className, 'one');