Skip to content

Commit

Permalink
Cached window in show/hide functions, since I was in the neighborhood.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Jan 23, 2012
1 parent 1609ea1 commit 201058b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/jquery.mobile.fixedToolbar.js
Expand Up @@ -132,10 +132,11 @@ define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.core", "jquery.mobile
show: function(){ show: function(){
var hideClass = "ui-fixed-hidden", var hideClass = "ui-fixed-hidden",
$el = this.element, $el = this.element,
scroll = $( window ).scrollTop(), $win = $( window ),
scroll = $win.scrollTop(),
elHeight = $el.height(), elHeight = $el.height(),
pHeight = $el.closest( ".ui-page" ).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"; tbtype = $el.is( ".ui-header" ) ? "header" : "footer";


if( this.options.transition && this.options.transition !== "none" && if( this.options.transition && this.options.transition !== "none" &&
Expand All @@ -156,10 +157,11 @@ define( [ "jquery", "jquery.mobile.widget", "jquery.mobile.core", "jquery.mobile
hide: function(){ hide: function(){
var hideClass = "ui-fixed-hidden", var hideClass = "ui-fixed-hidden",
$el = this.element, $el = this.element,
scroll = $( window ).scrollTop(), $win = $( window ),
scroll = $win.scrollTop(),
elHeight = $el.height(), elHeight = $el.height(),
pHeight = $el.closest( ".ui-page" ).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"; tbtype = $el.is( ".ui-header" ) ? "header" : "footer";


if( this.options.transition && this.options.transition !== "none" && if( this.options.transition && this.options.transition !== "none" &&
Expand Down

0 comments on commit 201058b

Please sign in to comment.