Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11268 from mitchlloyd/chains-remove-duplicate-method

Consolidate duplicated method
  • Loading branch information...
commit 0465f5b3eff21bae7d7dd54c3cf307f4491bb98a 2 parents f789afb + aa4e4d2
@krisselden krisselden authored
Showing with 4 additions and 22 deletions.
  1. +4 −22 packages/ember-metal/lib/chains.js
View
26 packages/ember-metal/lib/chains.js
@@ -298,35 +298,17 @@ ChainNode.prototype = {
}
if (this._parent) {
- this._parent.chainWillChange(this, this._key, 1, events);
+ this._parent.notifyChainChange(this, this._key, 1, events);
}
},
- chainWillChange(chain, path, depth, events) {
+ notifyChainChange(chain, path, depth, events) {
if (this._key) {
path = this._key + '.' + path;
}
if (this._parent) {
- this._parent.chainWillChange(this, path, depth + 1, events);
- } else {
- if (depth > 1) {
- events.push(this.value(), path);
- }
- path = 'this.' + path;
- if (this._paths[path] > 0) {
- events.push(this.value(), path);
- }
- }
- },
-
- chainDidChange(chain, path, depth, events) {
- if (this._key) {
- path = this._key + '.' + path;
- }
-
- if (this._parent) {
- this._parent.chainDidChange(this, path, depth + 1, events);
+ this._parent.notifyChainChange(this, path, depth + 1, events);
} else {
if (depth > 1) {
events.push(this.value(), path);
@@ -375,7 +357,7 @@ ChainNode.prototype = {
// and finally tell parent about my path changing...
if (this._parent) {
- this._parent.chainDidChange(this, this._key, 1, events);
+ this._parent.notifyChainChange(this, this._key, 1, events);
}
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.