This repository was archived by the owner on Oct 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
( function ( $ ) {
6
6
var libName = "core" ,
7
- scrollTimeout = 20 , // TODO expose timing as an attribute
7
+ scrollTimeout = 70 , // TODO expose timing as an attribute
8
8
scrollStartEnabledTimeout = 150 ;
9
9
10
10
module ( libName , {
11
- setup : function ( ) {
12
- $ ( "<div id='scroll-testing' style='height: 1000px'></div>" ) . appendTo ( "body" ) ;
11
+ setup : function ( ) {
12
+ $ ( "<div id='scroll-testing' " +
13
+ "style='height: " + ( screen . height * 3 ) + "px'></div>" ) . appendTo ( "body" ) ;
13
14
} ,
14
15
15
16
teardown : function ( ) {
18
19
} ) ;
19
20
20
21
var scrollUp = function ( pos ) {
21
- $ ( window ) . scrollTop ( 1000 ) ;
22
- ok ( $ ( window ) . scrollTop ( ) > 0 , $ ( window ) . scrollTop ( ) ) ;
22
+ $ ( window ) . scrollTop ( screen . height ) ;
23
+ deepEqual ( $ ( window ) . scrollTop ( ) > 0 , true ,
24
+ "After setting scrollTop, it is " + $ ( window ) . scrollTop ( ) ) ;
23
25
$ . mobile . silentScroll ( pos ) ;
24
26
} ;
25
27
26
28
asyncTest ( "silent scroll scrolls the page to the top by default" , function ( ) {
27
29
scrollUp ( ) ;
28
30
29
31
setTimeout ( function ( ) {
30
- deepEqual ( $ ( window ) . scrollTop ( ) , 0 ) ;
32
+ deepEqual ( $ ( window ) . scrollTop ( ) , $ . mobile . defaultHomeScroll ,
33
+ "After parameterless silentScroll(), scrollTop is $.mobile.defaultHomescroll: " +
34
+ $ . mobile . defaultHomeScroll ) ;
31
35
start ( ) ;
32
36
} , scrollTimeout ) ;
33
37
} ) ;
You can’t perform that action at this time.
0 commit comments