diff options
author | Pushkar Joshi | 2012-03-12 15:26:10 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-03-12 15:26:10 -0700 |
commit | 46b2e561fa6ca054cad58e4c372a598bbb7ee2c9 (patch) | |
tree | 38d1c8666098a10078834c1eaac3d455135bee12 /node_modules/montage/core/core.js | |
parent | 7b4b068cadc0af8ec7e930e1c2b429e945f96984 (diff) | |
parent | 69d90467865a1384725b2301901be2180c5a841f (diff) | |
download | ninja-46b2e561fa6ca054cad58e4c372a598bbb7ee2c9.tar.gz |
Merge branch 'master' into brushtool
Diffstat (limited to 'node_modules/montage/core/core.js')
-rwxr-xr-x | node_modules/montage/core/core.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/node_modules/montage/core/core.js b/node_modules/montage/core/core.js index ff94f303..8fcf7977 100755 --- a/node_modules/montage/core/core.js +++ b/node_modules/montage/core/core.js | |||
@@ -71,14 +71,14 @@ Object.defineProperty(M, "create", { | |||
71 | 71 | ||
72 | var newObject = Object.create(typeof aPrototype === "undefined" ? this : aPrototype); | 72 | var newObject = Object.create(typeof aPrototype === "undefined" ? this : aPrototype); |
73 | 73 | ||
74 | if (typeof newObject.didCreate === "function") { | ||
75 | newObject.didCreate(); | ||
76 | } | ||
77 | |||
78 | if (newObject._dependenciesForProperty) { | 74 | if (newObject._dependenciesForProperty) { |
79 | newObject._dependencyListeners = {}; | 75 | newObject._dependencyListeners = {}; |
80 | } | 76 | } |
81 | 77 | ||
78 | if (typeof newObject.didCreate === "function") { | ||
79 | newObject.didCreate(); | ||
80 | } | ||
81 | |||
82 | return newObject; | 82 | return newObject; |
83 | } else { | 83 | } else { |
84 | var result = Object.create(aPrototype); | 84 | var result = Object.create(aPrototype); |
@@ -713,13 +713,17 @@ if (!Object.seal) { | |||
713 | */ | 713 | */ |
714 | Object.defineProperty(M, "callDelegateMethod", { | 714 | Object.defineProperty(M, "callDelegateMethod", { |
715 | value: function(name) { | 715 | value: function(name) { |
716 | var delegate, delegateFunctionName, delegateFunction; | 716 | var delegate = this.delegate, delegateFunctionName, delegateFunction; |
717 | if (typeof this.identifier === "string") { | 717 | if (typeof this.identifier === "string") { |
718 | delegateFunctionName = this.identifier + name.toCapitalized(); | 718 | delegateFunctionName = this.identifier + name.toCapitalized(); |
719 | } else { | 719 | if (delegate && typeof (delegateFunction = delegate[delegateFunctionName]) === "function") { |
720 | delegateFunctionName = name; | 720 | // remove first argument |
721 | Array.prototype.shift.call(arguments); | ||
722 | return delegateFunction.apply(delegate, arguments); | ||
723 | } | ||
721 | } | 724 | } |
722 | if ((delegate = this.delegate) && typeof (delegateFunction = delegate[delegateFunctionName]) === "function") { | 725 | |
726 | if (delegate && typeof (delegateFunction = delegate[name]) === "function") { | ||
723 | // remove first argument | 727 | // remove first argument |
724 | Array.prototype.shift.call(arguments); | 728 | Array.prototype.shift.call(arguments); |
725 | return delegateFunction.apply(delegate, arguments); | 729 | return delegateFunction.apply(delegate, arguments); |