Skip to content

Commit

Permalink
remove genElementChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
errorrik committed Feb 22, 2019
1 parent bb56e8b commit df7492a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 34 deletions.
13 changes: 11 additions & 2 deletions src/view/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,12 @@ Component.prototype._repaintChildren = function () {
this.children = [];

this.slotChildren = [];
genElementChildren(this);

for (var i = 0; i < this.aNode.children.length; i++) {
var child = createNode(this.aNode.children[i], this);
this.children.push(child);
child.attach(this.el);
}
}
};

Expand Down Expand Up @@ -838,7 +843,11 @@ Component.prototype._attach = function (parentEl, beforeEl) {
insertBefore(this.el, parentEl, beforeEl);

if (!this._contentReady) {
genElementChildren(this);
for (var i = 0; i < this.aNode.children.length; i++) {
var child = createNode(this.aNode.children[i], this);
this.children.push(child);
child.attach(this.el);
}
this._contentReady = 1;
}
}
Expand Down
30 changes: 0 additions & 30 deletions src/view/gen-element-children.js

This file was deleted.

7 changes: 5 additions & 2 deletions src/view/node-own-only-children-attach.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


var insertBefore = require('../browser/insert-before');
var genElementChildren = require('./gen-element-children');


/**
Expand All @@ -23,7 +22,11 @@ function nodeOwnOnlyChildrenAttach(parentEl, beforeEl) {
this.sel = document.createComment(this.id);
insertBefore(this.sel, parentEl, beforeEl);

genElementChildren(this, parentEl, beforeEl);
for (var i = 0; i < this.aNode.children.length; i++) {
var child = createNode(this.aNode.children[i], this);
this.children.push(child);
child.attach(parentEl, beforeEl);
}

this.el = document.createComment(this.id);
insertBefore(this.el, parentEl, beforeEl);
Expand Down

0 comments on commit df7492a

Please sign in to comment.