refactor(LightDom): refactor the code
This commit is contained in:
parent
a02e7b5067
commit
c797a4fbd5
@ -38,7 +38,7 @@ export class LightDom {
|
|||||||
|
|
||||||
redistribute() {
|
redistribute() {
|
||||||
var tags = this.contentTags();
|
var tags = this.contentTags();
|
||||||
if (isPresent(tags)) {
|
if (tags.length > 0) {
|
||||||
redistributeNodes(tags, this.expandedDomNodes());
|
redistributeNodes(tags, this.expandedDomNodes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,8 +47,8 @@ export class LightDom {
|
|||||||
return this._collectAllContentTags(this.shadowDomView, []);
|
return this._collectAllContentTags(this.shadowDomView, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
_collectAllContentTags(item, acc:List<Content>):List<Content> {
|
_collectAllContentTags(view: View, acc:List<Content>):List<Content> {
|
||||||
var eis = item.elementInjectors;
|
var eis = view.elementInjectors;
|
||||||
for (var i = 0; i < eis.length; ++i) {
|
for (var i = 0; i < eis.length; ++i) {
|
||||||
var ei = eis[i];
|
var ei = eis[i];
|
||||||
if (isBlank(ei)) continue;
|
if (isBlank(ei)) continue;
|
||||||
@ -58,8 +58,8 @@ export class LightDom {
|
|||||||
|
|
||||||
} else if (ei.hasPreBuiltObject(ViewPort)) {
|
} else if (ei.hasPreBuiltObject(ViewPort)) {
|
||||||
var vp = ei.get(ViewPort);
|
var vp = ei.get(ViewPort);
|
||||||
ListWrapper.forEach(vp.contentTagContainers(), (c) => {
|
ListWrapper.forEach(vp.contentTagContainers(), (view) => {
|
||||||
this._collectAllContentTags(c, acc);
|
this._collectAllContentTags(view, acc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user