1- function ResizePageContentHeight ( page )
2- {
1+ function ResizePageContentHeight ( page ) {
32 var $page = $ ( page ) ;
4- var $content = $page . children ( ".ui-content" ) ;
5- var hh = $page . children ( ".ui-header" ) . outerHeight ( ) ; hh = hh ? hh : 0 ;
6- var fh = $page . children ( ".ui-footer" ) . outerHeight ( ) ; fh = fh ? fh : 0 ;
7- var pt = parseFloat ( $content . css ( "padding-top" ) ) ;
8- var pb = parseFloat ( $content . css ( "padding-bottom" ) ) ;
9- var wh = window . innerHeight ;
3+ $content = $page . children ( ".ui-content" ) ;
4+ hh = $page . children ( ".ui-header" ) . outerHeight ( ) ; hh = hh ? hh : 0 ;
5+ fh = $page . children ( ".ui-footer" ) . outerHeight ( ) ; fh = fh ? fh : 0 ;
6+ pt = parseFloat ( $content . css ( "padding-top" ) ) ;
7+ pb = parseFloat ( $content . css ( "padding-bottom" ) ) ;
8+ wh = window . innerHeight ;
109 $content . height ( wh - ( hh + fh ) - ( pt + pb ) ) ;
1110}
1211
1312$ ( ":jqmData(role='page')" ) . live ( "pageshow" , function ( event ) {
14- var $page = $ ( this ) ;
13+ var $page = $ ( this ) ;
1514
1615 // For the demos that use this script, we want the content area of each
1716 // page to be scrollable in the 'y' direction.
1817
19- $page . find ( ".ui-content" ) . attr ( "data-" + $ . mobile . ns + "scroll" , "y" ) ;
18+ $page . find ( ".ui-content" ) . attr ( "data-" + $ . mobile . ns + "scroll" , "y" ) ;
2019
2120 // This code that looks for [data-scroll] will eventually be folded
2221 // into the jqm page processing code when scrollview support is "official"
2322 // instead of "experimental".
2423
25- $page . find ( ":jqmData(scroll):not(.ui-scrollview-clip)" ) . each ( function ( ) {
26- var $this = $ ( this ) ;
24+ $page . find ( ":jqmData(scroll):not(.ui-scrollview-clip)" ) . each ( function ( ) {
25+ var $this = $ ( this ) ;
2726 // XXX: Remove this check for ui-scrolllistview once we've
2827 // integrated list divider support into the main scrollview class.
29- if ( $this . hasClass ( "ui-scrolllistview" ) )
28+ if ( $this . hasClass ( "ui-scrolllistview" ) ) {
3029 $this . scrolllistview ( ) ;
31- else
32- {
30+ } else {
3331 var st = $this . jqmData ( "scroll" ) + "" ;
34- var paging = st && st . search ( / ^ [ x y ] p $ / ) != - 1 ;
35- var dir = st && st . search ( / ^ [ x y ] / ) != - 1 ? st . charAt ( 0 ) : null ;
32+ paging = st && st . search ( / ^ [ x y ] p $ / ) != - 1 ;
33+ dir = st && st . search ( / ^ [ x y ] / ) != - 1 ? st . charAt ( 0 ) : null ,
3634
37- var opts = { } ;
38- if ( dir )
39- opts . direction = dir ;
40- if ( paging )
41- opts . pagingEnabled = true ;
42-
43- var method = $this . jqmData ( "scroll-method" ) ;
44- if ( method )
45- opts . scrollMethod = method ;
35+ opts = {
36+ direction : dir || undefined ,
37+ paging : paging || undefined ,
38+ scrollMethod : $this . jqmData ( "scroll-method" ) || undefined
39+ } ;
4640
4741 $this . scrollview ( opts ) ;
4842 }
@@ -56,5 +50,5 @@ $(":jqmData(role='page')").live("pageshow", function(event) {
5650} ) ;
5751
5852$ ( window ) . bind ( "orientationchange" , function ( event ) {
59- ResizePageContentHeight ( $ ( ".ui-page" ) ) ;
60- } ) ;
53+ ResizePageContentHeight ( $ ( ".ui-page" ) ) ;
54+ } ) ;
0 commit comments