diff options
Diffstat (limited to 'node_modules/montage/ui/scrollview.reel')
-rwxr-xr-x | node_modules/montage/ui/scrollview.reel/scrollview.js | 1090 |
1 files changed, 0 insertions, 1090 deletions
diff --git a/node_modules/montage/ui/scrollview.reel/scrollview.js b/node_modules/montage/ui/scrollview.reel/scrollview.js deleted file mode 100755 index d3516d03..00000000 --- a/node_modules/montage/ui/scrollview.reel/scrollview.js +++ /dev/null | |||
@@ -1,1090 +0,0 @@ | |||
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 | /** | ||
25 | These elements perform some native action when clicked/touched and so we | ||
26 | should not preventDefault when a mousedown/touchstart happens on them. | ||
27 | @private | ||
28 | */ | ||
29 | _NATIVE_ELEMENTS: { | ||
30 | value: ["A", "IFRAME", "EMBED", "OBJECT", "VIDEO", "AUDIO", "CANVAS", | ||
31 | "LABEL", "INPUT", "BUTTON", "SELECT", "TEXTAREA", "KEYGEN", | ||
32 | "DETAILS", "COMMAND" | ||
33 | ] | ||
34 | }, | ||
35 | |||
36 | /** | ||
37 | Description TODO | ||
38 | @private | ||
39 | */ | ||
40 | _axis: { | ||
41 | enumerable: false, | ||
42 | value: "both" | ||
43 | }, | ||
44 | /** | ||
45 | Description TODO | ||
46 | @type {Function} | ||
47 | @default {String} "both" | ||
48 | */ | ||
49 | axis: { | ||
50 | get: function () { | ||
51 | return this._axis; | ||
52 | }, | ||
53 | set: function (value) { | ||
54 | switch (value) { | ||
55 | case "vertical": | ||
56 | case "horizontal": | ||
57 | this._axis = value; | ||
58 | break; | ||
59 | default: | ||
60 | this._axis = "both"; | ||
61 | break; | ||
62 | } | ||
63 | this.needsDraw = true; | ||
64 | } | ||
65 | }, | ||
66 | /** | ||
67 | Description TODO | ||
68 | @private | ||
69 | */ | ||
70 | _displayScrollbars: { | ||
71 | enumerable: false, | ||
72 | value: "auto" | ||
73 | }, | ||
74 | /** | ||
75 | Description TODO | ||
76 | @type {Function} | ||
77 | @default {String} "auto" | ||
78 | */ | ||
79 | displayScrollbars: { | ||
80 | get: function () { | ||
81 | return this._displayScrollbars; | ||
82 | }, | ||
83 | set: function (value) { | ||
84 | switch (value) { | ||
85 | case "vertical": | ||
86 | case "horizontal": | ||
87 | case "both": | ||
88 | case "auto": | ||
89 | this._displayScrollbars = value; | ||
90 | break; | ||
91 | default: | ||
92 | this._displayScrollbars = "none"; | ||
93 | break; | ||
94 | } | ||
95 | this.needsDraw = true; | ||
96 | } | ||
97 | }, | ||
98 | /** | ||
99 | Description TODO | ||
100 | @private | ||
101 | */ | ||
102 | _content: { | ||
103 | enumerable: false, | ||
104 | value: null | ||
105 | }, | ||
106 | /** | ||
107 | Description TODO | ||
108 | @private | ||
109 | */ | ||
110 | _hasMomentum: { | ||
111 | enumerable: false, | ||
112 | value: true | ||
113 | }, | ||
114 | /** | ||
115 | Description TODO | ||
116 | @type {Function} | ||
117 | @default {Boolean} true | ||
118 | */ | ||
119 | hasMomentum: { | ||
120 | get: function () { | ||
121 | return this._hasMomentum; | ||
122 | }, | ||
123 | set: function (value) { | ||
124 | this._hasMomentum = value ? true : false; | ||
125 | } | ||
126 | }, | ||
127 | |||
128 | /** | ||
129 | Description TODO | ||
130 | @private | ||
131 | */ | ||
132 | _momentumDuration: { | ||
133 | enumerable: false, | ||
134 | value: 650 | ||
135 | }, | ||
136 | /** | ||
137 | Description TODO | ||
138 | @type {Function} | ||
139 | @default {Number} 650 | ||
140 | */ | ||
141 | momentumDuration: { | ||
142 | get: function () { | ||
143 | return this._momentumDuration; | ||
144 | }, | ||
145 | set: function (value) { | ||
146 | this._momentumDuration = isNaN(parseInt(value, 10)) ? 1 : parseInt(value, 10); | ||
147 | if (this._momentumDuration < 1) { | ||
148 | this._momentumDuration = 1; | ||
149 | } | ||
150 | } | ||
151 | }, | ||
152 | |||
153 | /** | ||
154 | Description TODO | ||
155 | @private | ||
156 | */ | ||
157 | _translateY: { | ||
158 | enumerable: false, | ||
159 | value: 0 | ||
160 | }, | ||
161 | /** | ||
162 | Description TODO | ||
163 | @private | ||
164 | */ | ||
165 | _nativeScrollTop: { | ||
166 | enumerable: false, | ||
167 | value: 0 | ||
168 | }, | ||
169 | /** | ||
170 | Description TODO | ||
171 | @private | ||
172 | */ | ||
173 | _nativeScrollTo: { | ||
174 | enumerable: false, | ||
175 | value: function (y) { | ||
176 | this._nativeScrollTop = y; | ||
177 | this._element.scrollTop = y; | ||
178 | } | ||
179 | }, | ||
180 | /** | ||
181 | Description TODO | ||
182 | @private | ||
183 | */ | ||
184 | _scrollX: { | ||
185 | enumerable: false, | ||
186 | value: 0 | ||
187 | }, | ||
188 | /** | ||
189 | Description TODO | ||
190 | @type {Function} | ||
191 | @default {Number} 0 | ||
192 | */ | ||
193 | scrollX: { | ||
194 | get: function () { | ||
195 | return this._scrollX; | ||
196 | }, | ||
197 | set: function (value) { | ||
198 | // TODO we repeat this parseInt pattern all over the place in this file | ||
199 | //var tmp = isNaN(parseInt(value, 10)) ? 0 : parseInt(value, 10); | ||
200 | // I'd suggest doing it this way to reduce the number of parseInts we do | ||
201 | var tmp = parseInt(value, 10); | ||
202 | tmp = isNaN(tmp) ? 0 : tmp; | ||
203 | |||
204 | if (tmp < 0) { | ||
205 | tmp = 0; | ||
206 | } | ||
207 | if (tmp > this._maxScrollX) { | ||
208 | tmp = this._maxScrollX; | ||
209 | } | ||
210 | if (this._scrollX != tmp) { | ||
211 | this._scrollX = tmp; | ||
212 | window.clearInterval(this._animationInterval); | ||
213 | this._updateScrollbars = false; | ||
214 | this.needsDraw = true; | ||
215 | } | ||
216 | } | ||
217 | }, | ||
218 | /** | ||
219 | Description TODO | ||
220 | @private | ||
221 | */ | ||
222 | _scrollY: { | ||
223 | enumerable: false, | ||
224 | value: 0 | ||
225 | }, | ||
226 | /** | ||