sproutcore 1.10.0.rc.2 → 1.10.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +14 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +9 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +14 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +103 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +4 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +17 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +62 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +14 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +26 -5
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/many_array.js +9 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/split_child.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +56 -54
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +221 -171
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +261 -315
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/split_child.js +137 -122
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +5 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +123 -98
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_display.js +18 -6
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/api.js +9 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +15 -16
- data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +170 -153
- data/lib/frameworks/sproutcore/frameworks/table/views/table.js +105 -101
- data/lib/frameworks/sproutcore/frameworks/table/views/table_head.js +0 -7
- data/lib/frameworks/sproutcore/frameworks/table/views/table_header.js +46 -56
- data/lib/frameworks/sproutcore/frameworks/table/views/table_row.js +0 -6
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/collection.js +12 -4
- data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +11 -8
- data/lib/frameworks/sproutcore/tests/phantomjs_runner.phantomjs +0 -1
- metadata +3 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -235
@@ -5,161 +5,196 @@
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
|
-
/*global module test
|
9
|
-
|
10
|
-
var pane, view
|
11
|
-
var appleURL='http://photos4.meetupstatic.com/photos/event/4/6/9/9/600_4518073.jpeg';
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
8
|
+
/*global module, test, ok, equals */
|
9
|
+
|
10
|
+
var pane, view, view2, view3, view4;
|
11
|
+
var appleURL = sc_static('images/sproutcore-512.png'); // 'http://photos4.meetupstatic.com/photos/event/4/6/9/9/600_4518073.jpeg';
|
12
|
+
|
13
|
+
module("SC.ScrollView", {
|
14
|
+
setup: function () {
|
15
|
+
SC.run(function () {
|
16
|
+
pane = SC.MainPane.create({
|
17
|
+
childViews: [
|
18
|
+
SC.ScrollView.extend({
|
19
|
+
contentView: SC.ImageView.design({ value: appleURL, layout: { height: 4000, width: 4000 }})
|
20
|
+
}),
|
21
|
+
SC.ScrollView.extend({
|
22
|
+
contentView: SC.ImageView.design({ value: appleURL, layout: { height: 2000, width: 2000 }})
|
23
|
+
}),
|
24
|
+
SC.ScrollView.extend({
|
25
|
+
layout: { height: 400, width: 400 },
|
26
|
+
contentView: SC.View.design({
|
27
|
+
layout: { height: 500, width: 500 },
|
28
|
+
childViews: [
|
29
|
+
SC.ScrollView.design({
|
30
|
+
layout: { height: 200, width: 200, centerX: 0, centerY: 0 },
|
31
|
+
contentView: SC.ImageView.design({ value: appleURL, layout: { height: 300, width: 300 }})
|
32
|
+
})
|
33
|
+
]
|
34
|
+
})
|
33
35
|
})
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
36
|
+
],
|
37
|
+
|
38
|
+
expectedVertLine: function (line) {
|
39
|
+
var ret = view.get('verticalLineScroll') * line;
|
40
|
+
var alt = view.get('maximumVerticalScrollOffset');
|
41
|
+
ret = (ret > alt) ? alt : ret;
|
42
|
+
|
43
|
+
return ret;
|
44
|
+
},
|
45
|
+
|
46
|
+
expectedHorzLine: function (line) {
|
47
|
+
var ret = view.get('horizontalLineScroll') * line;
|
48
|
+
var alt = view.get('maximumHorizontalScrollOffset');
|
49
|
+
ret = (ret > alt) ? alt : ret;
|
50
|
+
|
51
|
+
return ret;
|
52
|
+
},
|
53
|
+
|
54
|
+
expectedVertPage: function (page) {
|
55
|
+
var ret = view.get('verticalPageScroll') * page;
|
56
|
+
var alt = view.get('maximumVerticalScrollOffset');
|
57
|
+
ret = (ret > alt) ? alt : ret;
|
58
|
+
|
59
|
+
return ret;
|
60
|
+
},
|
61
|
+
|
62
|
+
expectedHorzPage: function (page) {
|
63
|
+
var ret = view.get('horizontalPageScroll') * page;
|
64
|
+
var alt = view.get('maximumHorizontalScrollOffset');
|
65
|
+
ret = (ret > alt) ? alt : ret;
|
66
|
+
|
67
|
+
return ret;
|
68
|
+
}
|
69
|
+
});
|
70
|
+
|
71
|
+
pane.append(); // make sure there is a layer...
|
72
|
+
});
|
73
|
+
|
74
|
+
view = pane.childViews[0];
|
75
|
+
view.get('containerView').get('frame').height = 100;
|
76
|
+
view.get('containerView').get('frame').width = 100;
|
77
|
+
|
78
|
+
view2 = pane.childViews[1];
|
79
|
+
view2.get('containerView').get('frame').height = 100;
|
80
|
+
view2.get('containerView').get('frame').width = 100;
|
73
81
|
|
74
82
|
view3 = pane.childViews[2];
|
75
83
|
view4 = view3.get('contentView').get('childViews')[0];
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
84
|
+
},
|
85
|
+
|
86
|
+
teardown: function () {
|
87
|
+
SC.run(function () {
|
88
|
+
pane.destroy();
|
89
|
+
});
|
90
|
+
pane = view = null;
|
91
|
+
}
|
82
92
|
});
|
83
93
|
|
84
94
|
|
85
95
|
|
86
|
-
test("Scrolling to a certain co-ordinate of the container view", function() {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
96
|
+
test("Scrolling to a certain co-ordinate of the container view", function () {
|
97
|
+
equals(view.get('horizontalScrollOffset'), 0, "Initial horizontal offset must be zero");
|
98
|
+
equals(view.get('verticalScrollOffset'), 0, "Initial vertical offset must be zero");
|
99
|
+
|
100
|
+
SC.run(function () {
|
101
|
+
view.scrollTo(100, 100);
|
102
|
+
equals(view.get('horizontalScrollOffset'), 100, "After scrolling to 100, horizontal offset must be");
|
103
|
+
equals(view.get('verticalScrollOffset'), 100, "After scrolling to 100, vertical offset must be");
|
104
|
+
});
|
92
105
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
106
|
+
SC.run(function () {
|
107
|
+
view.scrollTo(5000, 5000);
|
108
|
+
equals(view.get('horizontalScrollOffset'), view.get('maximumHorizontalScrollOffset'), "After scrolling to 400, horizontal offset must be maximum");
|
109
|
+
equals(view.get('verticalScrollOffset'), view.get('maximumVerticalScrollOffset'), "After scrolling to 400, vertical offset must be maximum");
|
110
|
+
});
|
98
111
|
});
|
99
112
|
|
100
|
-
test("Scrolling relative to the current possition of the container view", function() {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
113
|
+
test("Scrolling relative to the current possition of the container view", function () {
|
114
|
+
equals(view.get('horizontalScrollOffset'), 0, "Initial horizontal offset must be zero");
|
115
|
+
equals(view.get('verticalScrollOffset'), 0, "Initial vertical offset must be zero");
|
116
|
+
|
117
|
+
SC.run(function () {
|
118
|
+
view.scrollBy(100, 100);
|
119
|
+
equals(view.get('horizontalScrollOffset'), 100, "After scrolling by 100, horizontal offset must be");
|
120
|
+
equals(view.get('verticalScrollOffset'), 100, "After scrolling by 100, vertical offset must be");
|
121
|
+
});
|
122
|
+
|
123
|
+
SC.run(function () {
|
124
|
+
view.scrollBy(100, 100);
|
125
|
+
equals(view.get('horizontalScrollOffset'), 200, "After scrolling by 100, horizontal offset must be");
|
126
|
+
equals(view.get('verticalScrollOffset'), 200, "After scrolling by 100, vertical offset must be");
|
127
|
+
});
|
128
|
+
|
129
|
+
SC.run(function () {
|
130
|
+
view.scrollBy(5000, 5000);
|
131
|
+
equals(view.get('horizontalScrollOffset'), view.get('maximumHorizontalScrollOffset'), "After scrolling by 400, horizontal offset must be maximum");
|
132
|
+
equals(view.get('verticalScrollOffset'), view.get('maximumVerticalScrollOffset'), "After scrolling by 400, vertical offset must be maximum");
|
133
|
+
});
|
112
134
|
});
|
113
135
|
|
114
|
-
test("Scrolling through line by line", function() {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
136
|
+
test("Scrolling through line by line", function () {
|
137
|
+
var line = 3;
|
138
|
+
equals(view.get('horizontalScrollOffset'), 0, "Initial horizontal offset must be zero");
|
139
|
+
equals(view.get('verticalScrollOffset'), 0, "Initial vertical offset must be zero");
|
140
|
+
SC.run(function () {
|
141
|
+
view.scrollDownLine(line);
|
142
|
+
});
|
143
|
+
equals(view.get('horizontalScrollOffset'), 0, "After scrolling down by lines, horizontal offset is unchanged");
|
144
|
+
equals(view.get('verticalScrollOffset'), pane.expectedVertLine(line), "After scrolling down by lines, vertical offset must be");
|
145
|
+
SC.run(function () {
|
146
|
+
view.scrollUpLine(line);
|
147
|
+
});
|
122
148
|
});
|
123
149
|
|
124
|
-
test("maximumHorizontalScrollOffset() returns the maximum horizontal scroll dimension", function() {
|
125
|
-
var old_horizontalScrollOffset=2;
|
126
|
-
var old_verticalScrollOffset=2;
|
150
|
+
test("maximumHorizontalScrollOffset() returns the maximum horizontal scroll dimension", function () {
|
151
|
+
var old_horizontalScrollOffset = 2;
|
152
|
+
var old_verticalScrollOffset = 2;
|
127
153
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
154
|
+
SC.run(function () {
|
155
|
+
view2.set('horizontalScrollOffset', old_horizontalScrollOffset);
|
156
|
+
view2.set('verticalScrollOffset', old_verticalScrollOffset);
|
157
|
+
view2.scrollBy(5000, 0);
|
158
|
+
equals(view2.get('horizontalScrollOffset'), 1900, 'maximum y coordinate should be 1900');
|
159
|
+
});
|
132
160
|
|
133
|
-
equals(view2.get('horizontalScrollOffset'),1900, 'maximum y coordinate should be 1900');
|
134
161
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
162
|
+
SC.run(function () {
|
163
|
+
view2.set('horizontalScrollOffset', old_horizontalScrollOffset);
|
164
|
+
view2.set('verticalScrollOffset', old_verticalScrollOffset);
|
165
|
+
view2.scrollBy(-5000, 0);
|
166
|
+
equals(view2.get('horizontalScrollOffset'), 0, 'minimum y coordinate should be 0');
|
167
|
+
});
|
139
168
|
|
140
169
|
});
|
141
170
|
|
142
|
-
test("maximumVerticalScrollOffset() returns the maximum vertical scroll dimension", function() {
|
143
|
-
var old_horizontalScrollOffset=2;
|
144
|
-
var old_verticalScrollOffset=2;
|
171
|
+
test("maximumVerticalScrollOffset() returns the maximum vertical scroll dimension", function () {
|
172
|
+
var old_horizontalScrollOffset = 2;
|
173
|
+
var old_verticalScrollOffset = 2;
|
174
|
+
|
175
|
+
SC.run(function () {
|
176
|
+
view2.set('horizontalScrollOffset', old_horizontalScrollOffset);
|
177
|
+
view2.set('verticalScrollOffset', old_verticalScrollOffset);
|
178
|
+
view2.scrollBy(0, 5000);
|
179
|
+
equals(view2.get('verticalScrollOffset'), 1900, 'maximum coordinate should be 1900');
|
180
|
+
});
|
145
181
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
view2.
|
152
|
-
view2.set('verticalScrollOffset',old_verticalScrollOffset);
|
153
|
-
view2.scrollBy(0,-5000);
|
154
|
-
equals(view2.get('verticalScrollOffset'),0, 'The minimum y coordinate should be 0');
|
182
|
+
SC.run(function () {
|
183
|
+
view2.set('horizontalScrollOffset', old_horizontalScrollOffset);
|
184
|
+
view2.set('verticalScrollOffset', old_verticalScrollOffset);
|
185
|
+
view2.scrollBy(0, -5000);
|
186
|
+
});
|
187
|
+
equals(view2.get('verticalScrollOffset'), 0, 'The minimum y coordinate should be 0');
|
155
188
|
|
156
189
|
});
|
157
190
|
|
158
191
|
|
159
|
-
test("Mouse wheel events should only be captured if the scroll can scroll in the direction (both TOP-LEFT).", function() {
|
192
|
+
test("Mouse wheel events should only be captured if the scroll can scroll in the direction (both TOP-LEFT).", function () {
|
160
193
|
// FIRST GROUP: everything scrolled all the way to the top left
|
161
|
-
|
162
|
-
|
194
|
+
SC.run(function () {
|
195
|
+
view3.scrollTo(0, 0);
|
196
|
+
view4.scrollTo(0, 0);
|
197
|
+
});
|
163
198
|
|
164
199
|
// Scrolling further left is not captured by either scroll view
|
165
200
|
ok(!view3.mouseWheel({ wheelDeltaX: -10, wheelDeltaY: 0 }), 'The inner scroll view should not capture the mousewheel event since it cannot scroll further.');
|
@@ -178,9 +213,11 @@ test("Mouse wheel events should only be captured if the scroll can scroll in the
|
|
178
213
|
ok(view4.mouseWheel({ wheelDeltaX: 0, wheelDeltaY: 10 }), 'The outer scroll view should capture the mousewheel event since it can scroll further.');
|
179
214
|
});
|
180
215
|
|
181
|
-
test("Mouse wheel events should only be captured if the scroll can scroll in the direction (both BOTTOM-RIGHT).", function() {
|
182
|
-
|
183
|
-
|
216
|
+
test("Mouse wheel events should only be captured if the scroll can scroll in the direction (both BOTTOM-RIGHT).", function () {
|
217
|
+
SC.run(function () {
|
218
|
+
view3.scrollTo(114, 114);
|
219
|
+
view4.scrollTo(114, 114);
|
220
|
+
});
|
184
221
|
|
185
222
|
// Scrolling further right is not captured by either scroll view
|
186
223
|
ok(!view3.mouseWheel({ wheelDeltaX: 10, wheelDeltaY: 0 }), 'The inner scroll view should not capture the mousewheel event since it cannot scroll further.');
|
@@ -199,12 +236,14 @@ test("Mouse wheel events should only be captured if the scroll can scroll in the
|
|
199
236
|
ok(view4.mouseWheel({ wheelDeltaX: 0, wheelDeltaY: -10 }), 'The outer scroll view should capture the mousewheel event since it can scroll further.');
|
200
237
|
});
|
201
238
|
|
202
|
-
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll right).", function() {
|
239
|
+
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll right).", function () {
|
203
240
|
var elem = view4.get('layer'),
|
204
241
|
event;
|
205
242
|
|
206
|
-
|
207
|
-
|
243
|
+
SC.run(function () {
|
244
|
+
view3.scrollTo(0, 0);
|
245
|
+
view4.scrollTo(114, 114);
|
246
|
+
});
|
208
247
|
|
209
248
|
window.stop();
|
210
249
|
|
@@ -212,7 +251,7 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
212
251
|
SC.Event.trigger(elem, 'mousewheel', event);
|
213
252
|
|
214
253
|
SC.RunLoop.begin();
|
215
|
-
SC.Timer.schedule({ target: this, action: function() {
|
254
|
+
SC.Timer.schedule({ target: this, action: function () {
|
216
255
|
equals(view4.get('horizontalScrollOffset'), 114, 'The inner scroll view should still have horizontalScrollOffset');
|
217
256
|
equals(view3.get('horizontalScrollOffset'), 10, 'The outer scroll view should now have horizontalScrollOffset');
|
218
257
|
window.start();
|
@@ -220,12 +259,14 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
220
259
|
SC.RunLoop.end();
|
221
260
|
});
|
222
261
|
|
223
|
-
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll down).", function() {
|
262
|
+
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll down).", function () {
|
224
263
|
var elem = view4.get('layer'),
|
225
264
|
event;
|
226
265
|
|
227
|
-
|
228
|
-
|
266
|
+
SC.run(function () {
|
267
|
+
view3.scrollTo(0, 0);
|
268
|
+
view4.scrollTo(114, 114);
|
269
|
+
});
|
229
270
|
|
230
271
|
window.stop();
|
231
272
|
|
@@ -233,7 +274,7 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
233
274
|
SC.Event.trigger(elem, 'mousewheel', event);
|
234
275
|
|
235
276
|
SC.RunLoop.begin();
|
236
|
-
SC.Timer.schedule({ target: this, action: function() {
|
277
|
+
SC.Timer.schedule({ target: this, action: function () {
|
237
278
|
equals(view4.get('verticalScrollOffset'), 114, 'The inner scroll view should still have verticalScrollOffset');
|
238
279
|
equals(view3.get('verticalScrollOffset'), 10, 'The outer scroll view should now have verticalScrollOffset');
|
239
280
|
window.start();
|
@@ -241,33 +282,36 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
241
282
|
SC.RunLoop.end();
|
242
283
|
});
|
243
284
|
|
244
|
-
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll left).", function() {
|
285
|
+
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll left).", function () {
|
245
286
|
var elem = view4.get('layer'),
|
246
287
|
event;
|
247
288
|
|
248
|
-
|
249
|
-
|
289
|
+
SC.run(function () {
|
290
|
+
view3.scrollTo(114, 114);
|
291
|
+
view4.scrollTo(0, 0);
|
292
|
+
|
293
|
+
SC.Timer.schedule({ target: this, action: function () {
|
294
|
+
equals(view4.get('horizontalScrollOffset'), 0, 'The inner scroll view should still have horizontalScrollOffset');
|
295
|
+
equals(view3.get('horizontalScrollOffset'), 104, 'The outer scroll view should now have horizontalScrollOffset');
|
296
|
+
window.start();
|
297
|
+
}, interval: 200});
|
298
|
+
});
|
250
299
|
|
251
300
|
window.stop();
|
252
301
|
|
253
302
|
event = SC.Event.simulateEvent(elem, 'mousewheel', { wheelDeltaX: -10, wheelDeltaY: 0 });
|
254
303
|
SC.Event.trigger(elem, 'mousewheel', event);
|
255
304
|
|
256
|
-
SC.RunLoop.begin();
|
257
|
-
SC.Timer.schedule({ target: this, action: function() {
|
258
|
-
equals(view4.get('horizontalScrollOffset'), 0, 'The inner scroll view should still have horizontalScrollOffset');
|
259
|
-
equals(view3.get('horizontalScrollOffset'), 104, 'The outer scroll view should now have horizontalScrollOffset');
|
260
|
-
window.start();
|
261
|
-
}, interval: 200});
|
262
|
-
SC.RunLoop.end();
|
263
305
|
});
|
264
306
|
|
265
|
-
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll up).", function() {
|
307
|
+
test("Mouse wheel events not capturable by the inner scroll should bubble to the outer scroll (scroll up).", function () {
|
266
308
|
var elem = view4.get('layer'),
|
267
309
|
event;
|
268
310
|
|
269
|
-
|
270
|
-
|
311
|
+
SC.run(function () {
|
312
|
+
view3.scrollTo(114, 114);
|
313
|
+
view4.scrollTo(0, 0);
|
314
|
+
});
|
271
315
|
|
272
316
|
window.stop();
|
273
317
|
|
@@ -275,7 +319,7 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
275
319
|
SC.Event.trigger(elem, 'mousewheel', event);
|
276
320
|
|
277
321
|
SC.RunLoop.begin();
|
278
|
-
SC.Timer.schedule({ target: this, action: function() {
|
322
|
+
SC.Timer.schedule({ target: this, action: function () {
|
279
323
|
equals(view4.get('verticalScrollOffset'), 0, 'The inner scroll view should still have verticalScrollOffset');
|
280
324
|
equals(view3.get('verticalScrollOffset'), 104, 'The outer scroll view should now have verticalScrollOffset');
|
281
325
|
window.start();
|
@@ -283,12 +327,14 @@ test("Mouse wheel events not capturable by the inner scroll should bubble to the
|
|
283
327
|
SC.RunLoop.end();
|
284
328
|
});
|
285
329
|
|
286
|
-
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll right).", function() {
|
330
|
+
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll right).", function () {
|
287
331
|
var elem = view4.get('layer'),
|
288
332
|
event;
|
289
333
|
|
290
|
-
|
291
|
-
|
334
|
+
SC.run(function () {
|
335
|
+
view3.scrollTo(0, 0);
|
336
|
+
view4.scrollTo(0, 0);
|
337
|
+
});
|
292
338
|
|
293
339
|
window.stop();
|
294
340
|
|
@@ -296,7 +342,7 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
296
342
|
SC.Event.trigger(elem, 'mousewheel', event);
|
297
343
|
|
298
344
|
SC.RunLoop.begin();
|
299
|
-
SC.Timer.schedule({ target: this, action: function() {
|
345
|
+
SC.Timer.schedule({ target: this, action: function () {
|
300
346
|
equals(view4.get('horizontalScrollOffset'), 10, 'The inner scroll view should now have horizontalScrollOffset');
|
301
347
|
equals(view3.get('horizontalScrollOffset'), 0, 'The outer scroll view should still have horizontalScrollOffset');
|
302
348
|
window.start();
|
@@ -304,12 +350,14 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
304
350
|
SC.RunLoop.end();
|
305
351
|
});
|
306
352
|
|
307
|
-
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll up).", function() {
|
353
|
+
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll up).", function () {
|
308
354
|
var elem = view4.get('layer'),
|
309
355
|
event;
|
310
356
|
|
311
|
-
|
312
|
-
|
357
|
+
SC.run(function () {
|
358
|
+
view3.scrollTo(114, 114);
|
359
|
+
view4.scrollTo(114, 114);
|
360
|
+
});
|
313
361
|
|
314
362
|
window.stop();
|
315
363
|
|
@@ -317,7 +365,7 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
317
365
|
SC.Event.trigger(elem, 'mousewheel', event);
|
318
366
|
|
319
367
|
SC.RunLoop.begin();
|
320
|
-
SC.Timer.schedule({ target: this, action: function() {
|
368
|
+
SC.Timer.schedule({ target: this, action: function () {
|
321
369
|
equals(view4.get('verticalScrollOffset'), 104, 'The inner scroll view should now have verticalScrollOffset');
|
322
370
|
equals(view3.get('verticalScrollOffset'), 114, 'The outer scroll view should still have verticalScrollOffset');
|
323
371
|
window.start();
|
@@ -325,12 +373,14 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
325
373
|
SC.RunLoop.end();
|
326
374
|
});
|
327
375
|
|
328
|
-
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll left).", function() {
|
376
|
+
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll left).", function () {
|
329
377
|
var elem = view4.get('layer'),
|
330
378
|
event;
|
331
379
|
|
332
|
-
|
333
|
-
|
380
|
+
SC.run(function () {
|
381
|
+
view3.scrollTo(114, 114);
|
382
|
+
view4.scrollTo(114, 114);
|
383
|
+
});
|
334
384
|
|
335
385
|
window.stop();
|
336
386
|
|
@@ -338,7 +388,7 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
338
388
|
SC.Event.trigger(elem, 'mousewheel', event);
|
339
389
|
|
340
390
|
SC.RunLoop.begin();
|
341
|
-
SC.Timer.schedule({ target: this, action: function() {
|
391
|
+
SC.Timer.schedule({ target: this, action: function () {
|
342
392
|
equals(view4.get('horizontalScrollOffset'), 104, 'The inner scroll view should now have horizontalScrollOffset');
|
343
393
|
equals(view3.get('horizontalScrollOffset'), 114, 'The outer scroll view should still have horizontalScrollOffset');
|
344
394
|
window.start();
|
@@ -346,12 +396,14 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
346
396
|
SC.RunLoop.end();
|
347
397
|
});
|
348
398
|
|
349
|
-
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll down).", function() {
|
399
|
+
test("Mouse wheel events capturable by the inner scroll should not bubble to the outer scroll (scroll down).", function () {
|
350
400
|
var elem = view4.get('layer'),
|
351
401
|
event;
|
352
402
|
|
353
|
-
|
354
|
-
|
403
|
+
SC.run(function () {
|
404
|
+
view3.scrollTo(0, 0);
|
405
|
+
view4.scrollTo(0, 0);
|
406
|
+
});
|
355
407
|
|
356
408
|
window.stop();
|
357
409
|
|
@@ -359,12 +411,10 @@ test("Mouse wheel events capturable by the inner scroll should not bubble to the
|
|
359
411
|
SC.Event.trigger(elem, 'mousewheel', event);
|
360
412
|
|
361
413
|
SC.RunLoop.begin();
|
362
|
-
SC.Timer.schedule({ target: this, action: function() {
|
414
|
+
SC.Timer.schedule({ target: this, action: function () {
|
363
415
|
equals(view4.get('verticalScrollOffset'), 10, 'The inner scroll view should now have verticalScrollOffset');
|
364
416
|
equals(view3.get('verticalScrollOffset'), 0, 'The outer scroll view should still have verticalScrollOffset');
|
365
417
|
window.start();
|
366
418
|
}, interval: 200 });
|
367
419
|
SC.RunLoop.end();
|
368
420
|
});
|
369
|
-
|
370
|
-
|