code style cleanup

This commit is contained in:
Eddie Monge Jr. 2011-11-04 14:43:27 -07:00
parent 0b5f6dab5d
commit 0311c91f38

View file

@ -1,48 +1,42 @@
function ResizePageContentHeight(page)
{
function ResizePageContentHeight(page) {
var $page = $(page);
var $content = $page.children(".ui-content");
var hh = $page.children(".ui-header").outerHeight(); hh = hh ? hh : 0;
var fh = $page.children(".ui-footer").outerHeight(); fh = fh ? fh : 0;
var pt = parseFloat($content.css("padding-top"));
var pb = parseFloat($content.css("padding-bottom"));
var wh = window.innerHeight;
$content = $page.children(".ui-content");
hh = $page.children(".ui-header").outerHeight(); hh = hh ? hh : 0;
fh = $page.children(".ui-footer").outerHeight(); fh = fh ? fh : 0;
pt = parseFloat($content.css("padding-top"));
pb = parseFloat($content.css("padding-bottom"));
wh = window.innerHeight;
$content.height(wh - (hh + fh) - (pt + pb));
}
$(":jqmData(role='page')").live("pageshow", function(event) {
var $page = $(this);
var $page = $( this );
// For the demos that use this script, we want the content area of each
// page to be scrollable in the 'y' direction.
$page.find(".ui-content").attr("data-"+ $.mobile.ns +"scroll", "y");
$page.find( ".ui-content" ).attr( "data-" + $.mobile.ns + "scroll", "y" );
// This code that looks for [data-scroll] will eventually be folded
// into the jqm page processing code when scrollview support is "official"
// instead of "experimental".
$page.find(":jqmData(scroll):not(.ui-scrollview-clip)").each(function(){
var $this = $(this);
$page.find(":jqmData(scroll):not(.ui-scrollview-clip)").each(function () {
var $this = $( this );
// XXX: Remove this check for ui-scrolllistview once we've
// integrated list divider support into the main scrollview class.
if ($this.hasClass("ui-scrolllistview"))
if ( $this.hasClass( "ui-scrolllistview" ) ) {
$this.scrolllistview();
else
{
} else {
var st = $this.jqmData("scroll") + "";
var paging = st && st.search(/^[xy]p$/) != -1;
var dir = st && st.search(/^[xy]/) != -1 ? st.charAt(0) : null;
paging = st && st.search(/^[xy]p$/) != -1;
dir = st && st.search(/^[xy]/) != -1 ? st.charAt(0) : null,
var opts = {};
if (dir)
opts.direction = dir;
if (paging)
opts.pagingEnabled = true;
var method = $this.jqmData("scroll-method");
if (method)
opts.scrollMethod = method;
opts = {
direction: dir || undefined,
paging: paging || undefined,
scrollMethod: $this.jqmData("scroll-method") || undefined
};
$this.scrollview(opts);
}
@ -56,5 +50,5 @@ $(":jqmData(role='page')").live("pageshow", function(event) {
});
$(window).bind("orientationchange", function(event) {
ResizePageContentHeight($(".ui-page"));
});
ResizePageContentHeight( $(".ui-page") );
});