diff options
Diffstat (limited to 'node_modules/montage-user/ui/list.reel')
-rwxr-xr-x | node_modules/montage-user/ui/list.reel/list.html | 82 | ||||
-rwxr-xr-x | node_modules/montage-user/ui/list.reel/list.js | 98 |
2 files changed, 180 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/list.reel/list.html b/node_modules/montage-user/ui/list.reel/list.html new file mode 100755 index 00000000..98629f04 --- /dev/null +++ b/node_modules/montage-user/ui/list.reel/list.html | |||
@@ -0,0 +1,82 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <title></title> | ||
10 | <script type="text/montage-serialization"> | ||
11 | { | ||
12 | "repetition1": { | ||
13 | "module": "montage/ui/repetition.reel", | ||
14 | "name": "Repetition", | ||
15 | "properties": { | ||
16 | "element": { | ||
17 | "#": "repetition" | ||
18 | } | ||
19 | }, | ||
20 | "bindings": { | ||
21 | "content": { | ||
22 | "boundObject": {"@": "owner"}, | ||
23 | "boundObjectPropertyPath": "originalContent", | ||
24 | "oneway": true | ||
25 | }, | ||
26 | "objects": { | ||
27 | "boundObject": {"@": "owner"}, | ||
28 | "boundObjectPropertyPath": "objects", | ||
29 | "oneway": true | ||
30 | }, | ||
31 | "contentController": { | ||
32 | "boundObject": {"@": "owner"}, | ||
33 | "boundObjectPropertyPath": "contentController", | ||
34 | "oneway": true | ||
35 | }, | ||
36 | "isSelectionEnabled": { | ||
37 | "boundObject": {"@": "owner"}, | ||
38 | "boundObjectPropertyPath": "isSelectionEnabled", | ||
39 | "oneway": true | ||
40 | } | ||
41 | } | ||
42 | }, | ||
43 | "scrollview1": { | ||
44 | "module": "montage/ui/scrollview.reel", | ||
45 | "name": "Scrollview", | ||
46 | "properties": { | ||
47 | "element": { | ||
48 | "#": "scrollView" | ||
49 | } | ||
50 | }, | ||
51 | "bindings": { | ||
52 | "axis": { | ||
53 | "boundObject": {"@": "owner"}, | ||
54 | "boundObjectPropertyPath": "axis", | ||
55 | "oneway": true | ||
56 | } | ||
57 | } | ||
58 | }, | ||
59 | "owner": { | ||
60 | "module": "montage/ui/list.reel", | ||
61 | "name": "List", | ||
62 | "properties": { | ||
63 | "element": { | ||
64 | "#": "EA5D3E95-BA4E-4696-BBBE-B4DE2F6ED6C9" | ||
65 | }, | ||
66 | "_repetition": { | ||
67 | "@": "repetition1" | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | </script> | ||
73 | |||
74 | </head> | ||
75 | <body> | ||
76 | <div id="EA5D3E95-BA4E-4696-BBBE-B4DE2F6ED6C9"> | ||
77 | <div id="scrollView" class="montage-list-scrollView"> | ||
78 | <div data-montage-id="repetition"></div> | ||
79 | </div> | ||
80 | </div> | ||
81 | </body> | ||
82 | </html> | ||
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 | }); | ||