From 1a89bcf39eef9290f4266e14e88df757fd325ab3 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Thu, 8 Oct 2015 10:13:36 -0700 Subject: [PATCH] Clean up templatizer _pathEffectorImpl. --- src/lib/template/templatizer.html | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/lib/template/templatizer.html b/src/lib/template/templatizer.html index edc12c1a31..549bb8ee12 100644 --- a/src/lib/template/templatizer.html +++ b/src/lib/template/templatizer.html @@ -246,9 +246,7 @@ template._forwardParentProp = this._forwardParentProp.bind(this); } this._extendTemplate(template, proto); - if (template != this) { - template._pathEffector = this._pathEffectorTemplate.bind(this); - } + template._pathEffector = this._pathEffectorImpl.bind(this, template); } }, @@ -306,22 +304,14 @@ }, // Overrides Base notify-path module - _pathEffector: function(path, value, fromAbove) { - if (this._forwardParentPath) { - if (path.indexOf(this._parentPropPrefix) === 0) { - this._forwardParentPath(path.substring(8), value); - } - } - Polymer.Base._pathEffector.apply(this, arguments); - }, - - // Overrides Base notify-path module (for non-PE templates) - _pathEffectorTemplate: function(path, value, fromAbove) { + _pathEffectorImpl: function(template, path, value, fromAbove) { if (this._forwardParentPath) { if (path.indexOf(this._parentPropPrefix) === 0) { - this._forwardParentPath(path.substring(8), value); + var subPath = path.substring(this._parentPropPrefix.length); + this._forwardParentPath(subPath, value); } } + Polymer.Base._pathEffector.call(template, path, value, fromAbove); }, _constructorImpl: function(model, host) {