batmanjs/batman — pull request #839 by SoapyIllusions (2013-10-07 22:52:14+00:00)
Title: Remove extra node created by data-yield.

This removes the extra div created by `data-yield` as mentioned in #691. (The beginning of the PR talks about an extra div created by `data-partial` [solved] but the last few comments make reference to the one created by `data-yield`).

This PR currently breaks a few tests and is not exactly how I would like it to be implemented, but I wanted to open this up for discussion.

When `data-yield` is read by the binding parser, it sets the yield node in `Batman.DOM.Yields` and moves on.

Later when a view is created it will generate a generic wrapping `div` and insert the view's HTML into that div. After all of that has been done the view is either appended to it's superview, or yielded into a yield node, based on the view's `contentFor` property.

This patch has `View::loadView` look into the list of yielded nodes before it creates a wrapping div.

My only issue with this approach is we need to remove the `data-yield` property from the node, due to the order in which the node's bindings will parsed.

Thoughts?

/cc @nickjs @zhubert @pushrax