Skip to content

Commit

Permalink
Simplify.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 15, 2015
1 parent 15c1241 commit 4eda393
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/lib/template/dom-repeat.html
Expand Up @@ -204,19 +204,15 @@
},

detached: function() {
if (this._instances) {
for (var i=0; i<this._instances.length; i++) {
this._detachRow(i);
}
for (var i=0; i<this._instances.length; i++) {
this._detachRow(i);
}
},

attached: function() {
if (this._instances) {
var parentNode = Polymer.dom(this).parentNode;
for (var i=0; i<this._instances.length; i++) {
Polymer.dom(parentNode).insertBefore(this._instances[i].root, this);
}
var parentNode = Polymer.dom(this).parentNode;
for (var i=0; i<this._instances.length; i++) {
Polymer.dom(parentNode).insertBefore(this._instances[i].root, this);
}
},

Expand Down Expand Up @@ -567,10 +563,8 @@

// Implements extension point from Templatizer mixin
_showHideChildren: function(hidden) {
if (this._instances) {
for (var i=0; i<this._instances.length; i++) {
this._instances[i]._showHideChildren(hidden);
}
for (var i=0; i<this._instances.length; i++) {
this._instances[i]._showHideChildren(hidden);
}
},

Expand Down Expand Up @@ -607,22 +601,18 @@
// Called as side-effect of a host property change, responsible for
// notifying parent path change on each inst
_forwardParentProp: function(prop, value) {
if (this._instances) {
this._instances.forEach(function(inst) {
inst.__setProperty(prop, value, true);
}, this);
}
this._instances.forEach(function(inst) {
inst.__setProperty(prop, value, true);
}, this);
},

// Implements extension point from Templatizer
// Called as side-effect of a host path change, responsible for
// notifying parent path change on each inst
_forwardParentPath: function(path, value) {
if (this._instances) {
this._instances.forEach(function(inst) {
inst.notifyPath(path, value, true);
}, this);
}
this._instances.forEach(function(inst) {
inst.notifyPath(path, value, true);
}, this);
},

// Called as a side effect of a host items.<key>.<path> path change,
Expand Down

0 comments on commit 4eda393

Please sign in to comment.