diff options
author | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
commit | c6ae80c488621d4ac189cb63309b6258115f823a (patch) | |
tree | dfa26112e1830972fcb212bbb5b17c9a901c645f /node_modules/montage/data/control-listener.js | |
parent | 022e714cb5d10cd8575ab9907eddfb184a990b66 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-c6ae80c488621d4ac189cb63309b6258115f823a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into Timeline-merge-candidate
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 | }); | ||