balderdashy/mast — pull request #103 by particlebanana (2013-06-12 04:39:15+00:00)
Title: Use Backbone to generate $el

Backbone has an `_ensureElement` method that it uses to create the `el` context. Instead of just wrapping a template in a div, just use the method from Backbone.

This gives us all the options that Backbone.View has such as:

- className
- tagName
- attributes

I had to override the Backbone method because each Component has an id so the normal `_ensureElement` will give every component's view an id. This would be an issue if you want to use a component multiple times.

It should allow this:

```javascript
Mast.define('componentName', function() {
return {
tagName: 'ul',
className: 'user'
}
});
```

Which generates a normal backbone view el:

```html

```

Works in my tests but I want to make sure someone else looks it over. Still wrapping my head around the library.