Skip to content

Commit

Permalink
Replace _modelForPath.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Jul 23, 2016
1 parent 6ad9295 commit b02eda0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/lib/template/templatizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../path.html">
<script>

/**
Expand Down Expand Up @@ -339,7 +339,7 @@
if (this._forwardParentPath) {
if (path.indexOf(this._parentPropPrefix) === 0) {
var subPath = path.substring(this._parentPropPrefix.length);
var model = this._modelForPath(subPath);
var model = Polymer.Path.head(subPath);
if (model in this._parentProps) {
this._forwardParentPath(subPath, value);
}
Expand Down
3 changes: 2 additions & 1 deletion src/standard/annotations.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<link rel="import" href="../lib/annotations/annotations.html">
<link rel="import" href="../lib/resolve-url.html">
<link rel="import" href="../lib/path.html">
<script>

/**
Expand Down Expand Up @@ -149,7 +150,7 @@
if (signature) {
p.signature = signature;
} else {
p.model = this._modelForPath(p.value);
p.model = Polymer.Path.head(p.value);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/standard/effectBuilder.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<link rel="import" href="../lib/bind/accessors.html">
<link rel="import" href="../lib/bind/effects.html">

<link rel="import" href="../lib/path.html">
<script>
/**
* Support for property side effects.
Expand Down Expand Up @@ -298,7 +298,7 @@
}
// if not literal, look for structured path
if (!a.literal) {
a.model = this._modelForPath(arg);
a.model = Polymer.Path.head(arg);
// detect structured path (has dots)
a.structured = arg.indexOf('.') > 0;
if (a.structured) {
Expand Down
10 changes: 2 additions & 8 deletions src/standard/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@

_pathEffector: function(path, value) {
// get root property
var model = this._modelForPath(path);
var model = Path.head(path);
// search property effects of the root property for 'annotation' effects
var fx$ = this._propertyEffects && this._propertyEffects[model];
if (fx$) {
Expand Down Expand Up @@ -373,7 +373,7 @@
},

_notifyPathUp: function(path, value) {
var rootName = this._modelForPath(path);
var rootName = Path.head(path);
var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName);
var eventName = dashCaseName + this._EVENT_CHANGED;
// use a cached event here (_useCache: true) for efficiency
Expand All @@ -383,11 +383,6 @@
}, {bubbles: false, _useCache: true});
},

_modelForPath: function(path) {
var dot = path.indexOf('.');
return (dot < 0) ? path : path.slice(0, dot);
},

_EVENT_CHANGED: '-changed',

/**
Expand Down Expand Up @@ -607,7 +602,6 @@
_complexObserverPathEffect: Polymer.Base._complexObserverPathEffect,
_annotatedComputationPathEffect: Polymer.Base._annotatedComputationPathEffect,
_computePathEffect: Polymer.Base._computePathEffect,
_modelForPath: Polymer.Base._modelForPath,
_notifyBoundPaths: Polymer.Base._notifyBoundPaths,
_getPathParts: Polymer.Base._getPathParts
});
Expand Down

0 comments on commit b02eda0

Please sign in to comment.