diff options
Diffstat (limited to 'node_modules/montage-user/ui/scrollview.reel')
-rwxr-xr-x | node_modules/montage-user/ui/scrollview.reel/scrollview.js | 1230 |
1 files changed, 1230 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/scrollview.reel/scrollview.js b/node_modules/montage-user/ui/scrollview.reel/scrollview.js new file mode 100755 index 00000000..389b1858 --- /dev/null +++ b/node_modules/montage-user/ui/scrollview.reel/scrollview.js | |||
@@ -0,0 +1,1230 @@ | |||
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/scrollview.reel" | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | */ | ||
11 | var Montage = require("montage").Montage; | ||
12 | var Component = require("ui/component").Component; | ||
13 | /** | ||
14 | @class module:"montage/ui/scrollview.reel".Scrollview | ||
15 | @extends module:montage/ui/component.Component | ||
16 | */ | ||
17 | var Scrollview = exports.Scrollview = Montage.create(Component, /** @lends module:"montage/ui/scrollview.reel".Scrollview */ { | ||
18 | |||
19 | hasTemplate: { | ||
20 | enumerable: false, | ||
21 | value: false | ||
22 | }, | ||
23 | /** | ||
24 | Description TODO | ||
25 | @private | ||
26 | */ | ||
27 | _axis: { | ||
28 | enumerable: false, | ||
29 | value: "both" | ||
30 | }, | ||
31 | /** | ||
32 | Description TODO | ||
33 | @type {Function} | ||
34 | @default {String} "both" | ||
35 | */ | ||
36 | axis: { | ||
37 | get: function () { | ||
38 | return this._axis; | ||
39 | }, | ||
40 | set: function (value) { | ||
41 | switch (value) { | ||
42 | case "vertical": | ||
43 | case "horizontal": | ||
44 | this._axis = value; | ||
45 | break; | ||
46 | default: | ||
47 | this._axis = "both"; | ||
48 | break; | ||
49 | } | ||
50 | this.needsDraw = true; | ||
51 | } | ||
52 | }, | ||
53 | /** | ||
54 | Description TODO | ||
55 | @private | ||
56 | */ | ||
57 | _displayScrollbars: { | ||
58 | enumerable: false, | ||
59 | value: "auto" | ||
60 | }, | ||
61 | /** | ||
62 | Description TODO | ||
63 | @type {Function} | ||
64 | @default {String} "auto" | ||
65 | */ | ||
66 | displayScrollbars: { | ||
67 | get: function () { | ||
68 | return this._displayScrollbars; | ||
69 | }, | ||
70 | set: function (value) { | ||
71 | switch (value) { | ||
72 | case "vertical": | ||
73 | case "horizontal": | ||
74 | case "both": | ||
75 | case "auto": | ||
76 | this._displayScrollbars = value; | ||
77 | break; | ||
78 | default: | ||
79 | this._displayScrollbars = "none"; | ||
80 | break; | ||
81 | } | ||
82 | this.needsDraw = true; | ||
83 | } | ||
84 | }, | ||
85 | /** | ||
86 | Description TODO | ||
87 | @private | ||
88 | */ | ||
89 | _content: { | ||
90 | enumerable: false, | ||
91 | value: null | ||
92 | }, | ||
93 | /** | ||
94 | Description TODO | ||
95 | @private | ||
96 | */ | ||
97 | _hasMomentum: { | ||
98 | enumerable: false, | ||
99 | value: true | ||
100 | }, | ||
101 | /** | ||
102 | Description TODO | ||
103 | @type {Function} | ||
104 | @default {Boolean} true | ||
105 | */ | ||
106 | hasMomentum: { | ||
107 | get: function () { | ||
108 | return this._hasMomentum; | ||
109 | }, | ||
110 | set: function (value) { | ||
111 | this._hasMomentum = value ? true : false; | ||
112 | } | ||
113 | }, | ||
114 | /** | ||
115 | Description TODO | ||
116 | @private | ||
117 | */ | ||
118 | _hasBouncing: { | ||
119 | enumerable: false, | ||
120 | value: true | ||
121 | }, | ||
122 | /** | ||
123 | Description TODO | ||
124 | @type {Function} | ||
125 | @default {Boolean} true | ||
126 | */ | ||
127 | hasBouncing: { | ||
128 | get: function () { | ||
129 | return this._hasBouncing; | ||
130 | }, | ||
131 | set: function (value) { | ||
132 | this._hasBouncing = value ? true : false; | ||
133 | } | ||
134 | }, | ||
135 | /** | ||
136 | Description TODO | ||
137 | @private | ||
138 | */ | ||
139 | _momentumDuration: { | ||
140 | enumerable: false, | ||
141 | value: 650 | ||
142 | }, | ||
143 | /** | ||
144 | Description TODO | ||
145 | @type {Function} | ||
146 | @default {Number} 650 | ||
147 | */ | ||
148 | momentumDuration: { | ||
149 | get: function () { | ||
150 | return this._momentumDuration; | ||
151 | }, | ||
152 | set: function (value) { | ||
153 | this._momentumDuration = isNaN(parseInt(value, 10)) ? 1 : parseInt(value, 10); | ||
154 | if (this._momentumDuration < 1) { | ||
155 | this._momentumDuration = 1; | ||
156 | } | ||
157 | } | ||
158 | }, | ||
159 | /** | ||
160 | Description TODO | ||
161 | @private | ||
162 | */ | ||
163 | _bouncingDuration: { | ||
164 | enumerable: false, | ||
165 | value: 750 | ||
166 | }, | ||
167 | /** | ||
168 | Description TODO | ||
169 | @type {Function} | ||
170 | @default {Number} 750 | ||
171 | */ | ||
172 | bouncingDuration: { | ||
173 | get: function () { | ||
174 | return this._bouncingDuration; | ||
175 | }, | ||
176 | set: function (value) { | ||
177 | this._bouncingDuration = isNaN(parseInt(value, 10)) ? 1 : parseInt(value, 10); | ||
178 | if (this._bouncingDuration < 1) { | ||
179 | this._bouncingDuration = 1; | ||
180 | } | ||
181 | } | ||
182 | }, | ||
183 | /** | ||
184 | Description TODO | ||
185 | @private | ||
186 | */ | ||
187 | _translateY: { | ||
188 | enumerable: false, | ||
189 | value: 0 | ||
190 | }, | ||
191 | /** | ||
192 | Description TODO | ||
193 | @private | ||
194 | */ | ||
195 | _nativeScrollTop: { | ||
196 | enumerable: false, | ||
197 | value: 0 | ||
198 | }, | ||
199 | /** | ||
200 | Description TODO | ||
201 | @private | ||
202 | */ | ||
203 | _nativeScrollTo: { | ||
204 | enumerable: false, | ||
205 | value: function (y) { | ||
206 | this._nativeScrollTop = y; | ||
207 | this._element.scrollTop = y; | ||
208 | } | ||
209 | }, | ||
210 | /** | ||
211 | Description TODO | ||
212 | @private | ||
213 | */ | ||
214 | _scrollX: { | ||
215 | enumerable: false, | ||
216 | value: 0 | ||
217 | }, | ||
218 | /** | ||
219 | Description TODO | ||
220 | @type {Function} | ||
221 | @default {Number} 0 | ||
222 | */ | ||
223 | scrollX: { | ||