Cached window in show/hide functions, since I was in the neighborhood.

This commit is contained in:
Mat Marquis 2012-01-23 15:52:49 -05:00
parent 1609ea10e7
commit 201058bc90

View file

@ -132,10 +132,11 @@ define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.core", "jquery.mobile
show: function(){
var hideClass = "ui-fixed-hidden",
$el = this.element,
scroll = $( window ).scrollTop(),
$win = $( window ),
scroll = $win.scrollTop(),
elHeight = $el.height(),
pHeight = $el.closest( ".ui-page" ).height(),
viewportHeight = Math.min( screen.height, $( window ).height() ),
viewportHeight = Math.min( screen.height, $win.height() ),
tbtype = $el.is( ".ui-header" ) ? "header" : "footer";
if( this.options.transition && this.options.transition !== "none" &&
@ -156,10 +157,11 @@ define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.core", "jquery.mobile
hide: function(){
var hideClass = "ui-fixed-hidden",
$el = this.element,
scroll = $( window ).scrollTop(),
$win = $( window ),
scroll = $win.scrollTop(),
elHeight = $el.height(),
pHeight = $el.closest( ".ui-page" ).height(),
viewportHeight = Math.min( screen.height, $( window ).height() ),
viewportHeight = Math.min( screen.height, $win.height() ),
tbtype = $el.is( ".ui-header" ) ? "header" : "footer";
if( this.options.transition && this.options.transition !== "none" &&