diff options
author | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-01 00:09:27 -0800 |
commit | 8592cfb89db05f0e52d8c1b8c7046e6f49e3522d (patch) | |
tree | a6f9b5adfe16fd6232708f8a2345cd79056caca9 /node_modules/montage-user/ui/list.reel/list.js | |
parent | c6d1a1da9e7cdf477daf32410d80691eb1e828d5 (diff) | |
download | ninja-8592cfb89db05f0e52d8c1b8c7046e6f49e3522d.tar.gz |
Adding a montage framework copy for the user document
Adding a new montage copy containing the latest version of montage to use the new native widgets
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage-user/ui/list.reel/list.js')
-rwxr-xr-x | node_modules/montage-user/ui/list.reel/list.js | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/list.reel/list.js b/node_modules/montage-user/ui/list.reel/list.js new file mode 100755 index 00000000..02c91093 --- /dev/null +++ b/node_modules/montage-user/ui/list.reel/list.js | |||
@@ -0,0 +1,98 @@ | |||
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/ui/list.reel" | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | */ | ||
11 | var Montage = require("montage").Montage, | ||
12 | Component = require("ui/component").Component; | ||
13 | /** | ||
14 | @class module:"montage/ui/list.reel".List | ||
15 | @extends module:montage/ui/component.Component | ||
16 | */ | ||
17 | var List = exports.List = Montage.create(Component,/** @lends module:"montage/ui/list.reel".List# */ { | ||
18 | /** | ||
19 | Description TODO | ||
20 | @private | ||
21 | */ | ||
22 | _repetition: { | ||
23 | enumerable: false, | ||
24 | value: null | ||
25 | }, | ||
26 | /** | ||
27 | Description TODO | ||
28 | @type {Property} | ||
29 | @default null | ||
30 | */ | ||
31 | delegate: { | ||
32 | enumerable: false, | ||
33 | value: null | ||
34 | }, | ||
35 | |||
36 | objects: { | ||
37 | value: null | ||
38 | }, | ||
39 | |||
40 | contentController: { | ||
41 | value: null | ||
42 | }, | ||
43 | |||
44 | axis: { | ||
45 | value: null | ||
46 | }, | ||
47 | |||
48 | /** | ||
49 | Description TODO | ||
50 | @private | ||
51 | */ | ||
52 | isSelectionEnabled: { | ||
53 | value: null | ||
54 | }, | ||
55 | |||
56 | // Initialization | ||
57 | |||
58 | // TODO we should probably support the programmatic initialization of a list; forwarding the childComponents | ||
59 | // along to the repetition | ||
60 | // I want to say that if somebody knows enough to do that they know enough to append the child components' elements | ||
61 | // into the repetition, not the list | ||
62 | /** | ||
63 | Description TODO | ||
64 | @function | ||
65 | @param {Property} type TODO | ||
66 | @param {Property} listener TODO | ||
67 | @param {Property} useCapture TODO | ||
68 | @param {Property} atSignIndex TODO | ||
69 | @param {Property} bindingOrigin TODO | ||
70 | @param {Property} bindingPropertyPath TODO | ||
71 | @param {Property} bindingDescriptor TODO | ||
72 | @returns null or object | ||
73 | */ | ||
74 | propertyChangeBindingListener: { | ||
75 | value: function(type, listener, useCapture, atSignIndex, bindingOrigin, bindingPropertyPath, bindingDescriptor) { | ||
76 | |||
77 | // TODO could forward along less-special bindings this way such as "objects" in general, just to reduce an extra | ||
78 | // hop in the derived property path | ||
79 | if (bindingDescriptor.boundObjectPropertyPath.match(/objectAtCurrentIteration/)) { | ||
80 | if (this._repetition) { | ||
81 | // TODO not sure how safe this is, but I may want to use it in the repetition's oimplementation of | ||
82 | // this method as well as it looks like it should obviously be faster than replicating the descriptor | ||
83 | bindingDescriptor.boundObject = this._repetition; | ||
84 | return this._repetition.propertyChangeBindingListener.apply(this._repetition, arguments); | ||
85 | } else { | ||
86 | // Don't install this binding; we'll deal with that when the children are actually used inside | ||
87 | // the repetition and try to bind to the list directly in the future | ||
88 | // TODO maybe we could rewrite the bindingDescriptor at this point on the bindingOrigin | ||
89 | // to prevent this man-in-the-middle game we're playing with the list later on | ||
90 | return null; | ||
91 | } | ||
92 | } else { | ||
93 | return Object.prototype.propertyChangeBindingListener.apply(this, arguments); | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | }); | ||