Prevent creation of empty entry in _connectorCache for raw templates. (#4296)
This commit is contained in:
parent
e4074f75b1
commit
deda9a6908
|
@ -86,13 +86,12 @@ function buildConnectorCache() {
|
||||||
});
|
});
|
||||||
|
|
||||||
findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) {
|
findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) {
|
||||||
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
|
||||||
|
|
||||||
const mixin = {templateName: resource.replace('javascripts/', '')};
|
const mixin = {templateName: resource.replace('javascripts/', '')};
|
||||||
let viewClass = uniqueViews[uniqueName];
|
let viewClass = uniqueViews[uniqueName];
|
||||||
|
|
||||||
if (viewClass) {
|
if (viewClass) {
|
||||||
// We are going to add it back with the proper template
|
// We are going to add it back with the proper template
|
||||||
|
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
||||||
_connectorCache[outletName].removeObject(viewClass);
|
_connectorCache[outletName].removeObject(viewClass);
|
||||||
} else {
|
} else {
|
||||||
if (!/\.raw$/.test(uniqueName)) {
|
if (!/\.raw$/.test(uniqueName)) {
|
||||||
|
@ -101,6 +100,7 @@ function buildConnectorCache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewClass) {
|
if (viewClass) {
|
||||||
|
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
||||||
_connectorCache[outletName].pushObject(viewClass.extend(mixin));
|
_connectorCache[outletName].pushObject(viewClass.extend(mixin));
|
||||||
} else {
|
} else {
|
||||||
// we have a raw template
|
// we have a raw template
|
||||||
|
|
Loading…
Reference in New Issue