tildeio/ember-extension — pull request #133 by satchmorun (2014-03-17 05:00:02+00:00)
Title: Clean up DOM if no Ember application

Not everything I do is written with Ember, and I keep doing double-takes when I see `data-ember-extension="1"` when I'm not expecting to be in an Ember app.

This PR hooks into the `onReady` call in `onEmberReady`. It gives the async loaders half a second to load up Ember and fire the `'Ember.Application'` event. If we hit the half-second, give up and remove the added attributes. (500 ms is an arbitrary delay, just picked what felt like a reasonable number)

I looked to make the minimal set of changes necessary for this, and there may be edge cases I haven't thought of, and maybe even extra stuff (I didn't check for globals) that could be removed. I'd welcome and appreciate any feedback.