diff options
author | Eric Guzman | 2012-06-20 19:42:03 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-20 19:42:03 -0700 |
commit | 3270aac4980c908f305fb53abadda5121ff6b9cb (patch) | |
tree | 6255aaab239fde71b1f4862dd70de7be62f48b85 /node_modules/montage/data/control-listener.js | |
parent | a5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff) | |
parent | 87377c81da06abf6d656017859830a3ab2902f0e (diff) | |
download | ninja-3270aac4980c908f305fb53abadda5121ff6b9cb.tar.gz |
Merge branch 'binding' of github.com:dhg637/ninja-internal into binding
Diffstat (limited to 'node_modules/montage/data/control-listener.js')
-rwxr-xr-x | node_modules/montage/data/control-listener.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/node_modules/montage/data/control-listener.js b/node_modules/montage/data/control-listener.js new file mode 100755 index 00000000..4b242cbb --- /dev/null +++ b/node_modules/montage/data/control-listener.js | |||
@@ -0,0 +1,47 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | /** | ||
7 | @module montage/data/control-listener | ||
8 | @requires montage/core/core | ||
9 | @requires montage/core/logger | ||
10 | */ | ||
11 | var Montage = require("montage").Montage; | ||
12 | var logger = require("core/logger").logger("controlListener"); | ||
13 | /** | ||
14 | @class module:montage/data/control-listener.ControlListener | ||
15 | @extends module:montage/core/core.Montage | ||
16 | */ | ||
17 | var ControlListener = exports.ControlListener = Montage.create(Montage,/** @lends module:montage/data/control-listener.ControlListener# */ { | ||
18 | /** | ||
19 | Description TODO | ||
20 | @function | ||
21 | @param {Property} delegate TODO | ||
22 | @param {Property} key TODO | ||
23 | @param {Property} identifier TODO | ||
24 | @returns null | ||
25 | */ | ||
26 | callbackForKey: { | ||
27 | value: function(delegate, key, identifier) { | ||
28 | if (typeof delegate !== "function") { | ||
29 | return delegate; | ||
30 | } | ||
31 | if ((typeof delegate !== "object") || (typeof key !== "string")) { | ||
32 | return null; | ||
33 | } | ||
34 | if (identifier) { | ||
35 | var newKey = identifier + key.toCapitalized(); | ||
36 | if (typeof delegate[newKey] === "function") { | ||
37 | return delegate[newKey]; | ||
38 | } | ||
39 | } | ||
40 | if (typeof delegate[key] === "function") { | ||
41 | return delegate[key]; | ||
42 | } | ||
43 | return null; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | }); | ||