rotundasoftware / backbone.collectionView

Easily render backbone.js collections. In addition to managing model views, this class supports automatic selection of models in response to clicks, reordering models via drag and drop, and more.
http://rotundasoftware.github.io/backbone.collectionView/
Other
171 stars 27 forks source link

Wrap to <li/> only if element is't <li/> #40

Closed quard8 closed 10 years ago

quard8 commented 10 years ago

In some cases, it's not necessary to wrap element in <li/>. For example with this modelView:

var view = new Backbone.View.extend({
   tagName: 'li',
   render: function() {
      this.$el.html('some text');
   }
});

Rendered DOM will be:

<ul>
  <li data-model-cid="1">
    <li>some text</li>
  </li>
</ul>

So, my patch checks if we already have <li/> and only adds "data" attribute.

dgbeck commented 10 years ago

Looks Good! Thanks very much for contribution!

@go-oleg if you don't see any issues, you want to merge and make sure all coding conventions are in order? Thx!