Add attributes parameter to Backbone.View. All attributes are being applied to view's this.el during element creation.

This commit is contained in:
Pavel Karoukin
2011-01-10 23:06:24 -06:00
parent 440d1415fb
commit c3da552f3b

View File

@@ -892,6 +892,7 @@
_ensureElement : function() {
if (!this.el) {
var attrs = {};
if (this.attributes) attrs = this.attributes;
if (this.id) attrs.id = this.id;
if (this.className) attrs['class'] = this.className;
this.el = this.make(this.tagName, attrs);