Skip to content

Commit

Permalink
Merge pull request #11754 from martndemus/cleanup-view-empty-view-is-…
Browse files Browse the repository at this point in the history
…global

[CLEANUP beta] Remove emptyView="Global.foo" for view
  • Loading branch information
mixonic committed Jul 15, 2015
2 parents c2196e2 + 9ff3cee commit 5d18fcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
10 changes: 2 additions & 8 deletions packages/ember-views/lib/streams/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember-metal/core';
import { get } from 'ember-metal/property_get';
import { isGlobal } from 'ember-metal/path_cache';
import { fmt } from 'ember-runtime/system/string';
import { read, isStream } from 'ember-metal/streams/utils';
import ControllerMixin from 'ember-runtime/mixins/controller';
Expand All @@ -10,13 +9,8 @@ export function readViewFactory(object, container) {
var viewClass;

if (typeof value === 'string') {
if (isGlobal(value)) {
viewClass = get(null, value);
Ember.deprecate('Resolved the view "' + value + '" on the global context. Pass a view name to be looked up on the container instead, such as {{view "select"}}.', !viewClass, { url: 'http://emberjs.com/guides/deprecations/#toc_global-lookup-of-views' });
} else {
Ember.assert('View requires a container to resolve views not passed in through the context', !!container);
viewClass = container.lookupFactory('view:' + value);
}
Ember.assert('View requires a container to resolve views not passed in through the context', !!container);
viewClass = container.lookupFactory('view:' + value);
} else {
viewClass = value;
}
Expand Down
26 changes: 0 additions & 26 deletions packages/ember-views/tests/views/collection_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,32 +564,6 @@ QUnit.test('should render the emptyView if content array is empty and emptyView
ok(view.$().find('kbd:contains("THIS IS AN EMPTY VIEW")').length, 'displays empty view');
});

QUnit.test('should render the emptyView if content array is empty and emptyView is given as global string [DEPRECATED]', function() {
expectDeprecation(/Resolved the view "App.EmptyView" on the global context/);

Ember.lookup = {
App: {
EmptyView: View.extend({
tagName: 'kbd',
template: compile('THIS IS AN EMPTY VIEW')
})
}
};

view = CollectionView.create({
tagName: 'del',
content: Ember.A(),

emptyView: 'App.EmptyView'
});

run(function() {
view.append();
});

ok(view.$().find('kbd:contains("THIS IS AN EMPTY VIEW")').length, 'displays empty view');
});

QUnit.test('should lookup against the container if itemViewClass is given as a string', function() {
var ItemView = View.extend({
template: compile('{{view.content}}')
Expand Down

0 comments on commit 5d18fcf

Please sign in to comment.