emberjs/ember.js — pull request #927 by pangratz (2012-06-01 12:02:55+00:00)
Title: Append a view to it's applications' rootElement

This commit changes the behavior of Ember.View#append: it now appends the view to the rootElement of the application, in which it is defined.

Let's say you have the following setup:

App = Ember.Application.create({ rootElement: '#my-root' });
App.MyView = Ember.View.extend({...});
App.view = Ember.View.create({...});

If you invoke `append()` on a view instance, it is appended to the rootElement of the application:

App.view.append(); // appended to #my-root

If you create an instance of a view, it's appended also to the rootElement:

App.View.create().append(); // appended to #my-root

If you append a general Ember.View, it's added to the first application which has been defined.

Ember.View.create().append(); // appended to #my-root

This is the rebased to master version of PR #716