mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Add attributes parameter to Backbone.View. All attributes are being applied to view's this.el during element creation.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user