tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.61k stars 193 forks source link

Add temporary workaround for SimpleDOM #425

Open chancancode opened 8 years ago

chancancode commented 8 years ago

Requires https://github.com/krisselden/morph-range/pull/8

The current parseHTML implementation requires some DOM APIs not implemented in SimpleDOM. This commit adds a temporary workaround to support using SimpleDOM on the server.

In the future, we will move towards using insertAdjacentHTML and innerHTML= as the main APIs and remove the need of parseHTML altogether.

This commit also reverts a previous commit that introduced the setMorphHTML method, which does exactly what Morph#setHTML does.

(I added a test, but it's not currently running because we disabled all the node tests since https://github.com/tildeio/htmlbars/pull/359... @stefanpenner ? Anyhow, this particular change is very easy to verify by :eyes:, so it's not critical to re-enable them just to merge this PR.)

chancancode commented 8 years ago

@krisselden @wycats can you take a look? :eyes:

e00dan commented 8 years ago

Hey, what's the status of this? :) @chancancode