diff options
author | Ananya Sen | 2012-02-03 09:57:41 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-03 09:57:41 -0800 |
commit | c093dd13a84ce6eb3e00a672c38a808093c5d966 (patch) | |
tree | 5dfd4a800bbbe02a8cbcb3ffeee542686bc258bb /node_modules/montage/ui/list.reel/list.js | |
parent | 79b0173eeca079dec42ff1480182656dbe3af44f (diff) | |
parent | 8e06b63e5eab5558823f4923e20a832c8b36cbe2 (diff) | |
download | ninja-c093dd13a84ce6eb3e00a672c38a808093c5d966.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Conflicts:
js/io/document/document-controller.js
js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
js/io/ui/save-as-dialog.reel/save-as-dialog.js
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/list.reel/list.js')
-rwxr-xr-x | node_modules/montage/ui/list.reel/list.js | 192 |
1 files changed, 9 insertions, 183 deletions
diff --git a/node_modules/montage/ui/list.reel/list.js b/node_modules/montage/ui/list.reel/list.js index 2af99bf4..02c91093 100755 --- a/node_modules/montage/ui/list.reel/list.js +++ b/node_modules/montage/ui/list.reel/list.js | |||
@@ -23,23 +23,7 @@ var List = exports.List = Montage.create(Component,/** @lends module:"montage/ui | |||
23 | enumerable: false, | 23 | enumerable: false, |
24 | value: null | 24 | value: null |
25 | }, | 25 | }, |
26 | /** | 26 | /** |
27 | Description TODO | ||
28 | @private | ||
29 | */ | ||
30 | _scrollview: { | ||
31 | enumerable: false, | ||
32 | value: null | ||
33 | }, | ||
34 | /** | ||
35 | Description TODO | ||
36 | @private | ||
37 | */ | ||
38 | _orphanedChildren: { | ||
39 | enumerable: false, | ||
40 | value: null | ||
41 | }, | ||
42 | /** | ||
43 | Description TODO | 27 | Description TODO |
44 | @type {Property} | 28 | @type {Property} |
45 | @default null | 29 | @default null |
@@ -48,131 +32,25 @@ var List = exports.List = Montage.create(Component,/** @lends module:"montage/ui | |||
48 | enumerable: false, | 32 | enumerable: false, |
49 | value: null | 33 | value: null |
50 | }, | 34 | }, |
51 | 35 | ||
52 | //TODO make some convenient forwarding property or something, this is a little tedious | 36 | objects: { |
53 | |||
54 | // Properties to forward to the scrollview | ||
55 | /** | ||
56 | Description TODO | ||
57 | @private | ||
58 | */ | ||
59 | _axisForScrollview: { | ||
60 | enumerable: false, | ||
61 | value: null | 37 | value: null |
62 | }, | 38 | }, |
63 | /** | 39 | |
64 | Description TODO | 40 | contentController: { |
65 | @type {Function} | ||
66 | @default null | ||
67 | */ | ||
68 | axis: { | ||
69 | enumerable: false, | ||
70 | get: function() { | ||
71 | if (this._scrollview) { | ||
72 | return this._scrollview.axis; | ||
73 | } else { | ||
74 | return this._axisForScrollview; | ||
75 | } | ||
76 | }, | ||
77 | set: function(value) { | ||
78 | if (this._scrollview) { | ||
79 | this._scrollview.axis = value; | ||
80 | } else { | ||
81 | this._axisForScrollview = value; | ||
82 | } | ||
83 | } | ||
84 | }, | ||
85 | |||
86 | //Properties to forward to the repetition | ||
87 | /** | ||
88 | Description TODO | ||
89 | @private | ||
90 | */ | ||
91 | _objectsForRepetition: { | ||
92 | enumerable: false, | ||
93 | value: null | 41 | value: null |
94 | }, | 42 | }, |
95 | /** | 43 | |
96 | Description TODO | 44 | axis: { |
97 | @type {Function} | ||
98 | @default null | ||
99 | */ | ||
100 | objects: { | ||
101 | enumerable: false, | ||
102 | get: function() { | ||
103 | if (this._repetition) { | ||
104 | return this._repetition.objects; | ||
105 | } else { | ||
106 | return this._objectsForRepetition; | ||
107 | } | ||
108 | }, | ||
109 | set: function(value) { | ||
110 | if (this._repetition) { | ||
111 | this._repetition.objects = value; | ||
112 | } else { | ||
113 | this._objectsForRepetition = value; | ||
114 | } | ||
115 | } | ||
116 | }, | ||
117 | /** | ||
118 | Description TODO | ||
119 | @private | ||
120 | */ | ||
121 | _contentControllerForRepetition: { | ||
122 | enumerable: false, | ||
123 | value: null | 45 | value: null |
124 | }, | 46 | }, |
125 | /** | 47 | |
126 | Description TODO | ||
127 | @type {Function} | ||
128 | @default null | ||
129 | */ | ||
130 | contentController: { | ||
131 | enumerable: false, | ||
132 | get: function() { | ||
133 | if (this._repetition) { | ||
134 | return this._repetition.contentController; | ||
135 | } else { | ||
136 | return this._contentControllerForRepetition; | ||
137 | } | ||
138 | }, | ||
139 | set: function(value) { | ||
140 | if (this._repetition) { | ||
141 | this._repetition.contentController = value; | ||
142 | } else { | ||
143 | this._contentControllerForRepetition = value; | ||
144 | } | ||
145 | } | ||
146 | }, | ||
147 | /** | 48 | /** |
148 | Description TODO | 49 | Description TODO |
149 | @private | 50 | @private |
150 | */ | 51 | */ |
151 | _isSelectionEnabledForRepetition: { | ||
152 | enumerable: false, | ||
153 | value: null | ||
154 | }, | ||
155 | /** | ||
156 | Description TODO | ||
157 | @type {Function} | ||
158 | @default null | ||
159 | */ | ||
160 | isSelectionEnabled: { | 52 | isSelectionEnabled: { |
161 | enumerable: false, | 53 | value: null |
162 | get: function() { | ||
163 | if (this._repetition) { | ||
164 | return this._repetition.isSelectionEnabled; | ||
165 | } else { | ||
166 | return this._isSelectionEnabledForRepetition; | ||
167 | } | ||
168 | }, | ||
169 | set: function(value) { | ||
170 | if (this._repetition) { | ||
171 | this._repetition.isSelectionEnabled = value; | ||
172 | } else { | ||
173 | this._isSelectionEnabledForRepetition = value; | ||
174 | } | ||
175 | } | ||
176 | }, | 54 | }, |
177 | 55 | ||
178 | // Initialization | 56 | // Initialization |
@@ -214,58 +92,6 @@ var List = exports.List = Montage.create(Component,/** @lends module:"montage/ui | |||
214 | } else { | 92 | } else { |
215 | return Object.prototype.propertyChangeBindingListener.apply(this, arguments); | 93 | return Object.prototype.propertyChangeBindingListener.apply(this, arguments); |
216 | } | 94 | } |
217 | }}, | ||
218 | |||
219 | /** | ||
220 | Description TODO | ||
221 | @function | ||
222 | */ | ||
223 | deserializedFromTemplate: { | ||
224 | value: function() { | ||
225 | // The childComponents of the list need to be pulled aside for a moment so we can give them to the repetition | ||
226 | // This is logically where people think these components are ending up anyway | ||
227 | this._orphanedChildren = this.childComponents; | ||
228 | this.childComponents = null; | ||
229 | } | ||
230 | }, | ||
231 | |||
232 | /** | ||
233 | Description TODO | ||
234 | @function | ||
235 | */ | ||
236 | templateDidLoad: { | ||
237 | value: function() { | ||
238 | // Once we know that the template for the list itself has been deserialized we actually | ||
239 | // move the orphaned children of the list into the repetition | ||
240 | var orphanedFragment, | ||
241 | currentContentRange = this.element.ownerDocument.createRange(); | ||
242 | currentContentRange.selectNodeContents(this.element); | ||
243 | orphanedFragment = currentContentRange.extractContents(); | ||
244 | |||
245 | this._repetition.element.appendChild(orphanedFragment); | ||
246 | this._repetition.childComponents = this._orphanedChildren; | ||
247 | this._repetition.needsDraw = true; | ||
248 | |||
249 | if (this._objectsForRepetition !== null) { | ||
250 | this._repetition.objects = this._objectsForRepetition; | ||
251 | this._objectsForRepetition = null; | ||
252 | } | ||
253 | |||
254 | if (this._contentControllerForRepetition !== null) { | ||
255 | this._repetition.contentController = this._contentControllerForRepetition; | ||
256 | this._contentControllerForRepetition = null; | ||
257 | } | ||
258 | |||
259 | if (this._isSelectionEnabledForRepetition !== null) { | ||
260 | this._repetition.isSelectionEnabled = this._isSelectionEnabledForRepetition; | ||
261 | this._isSelectionEnabledForRepetition = null; | ||
262 | } | ||
263 | |||
264 | // Don't forget to pass along properties to the scrollview | ||