Permalink
Browse files

the first argument of updatePagePadding is expected to be a page, but…

… when it is called from the throttledResize binding, it ends up as an event object, and the padding was being set on that instead of the page. This adds a check to ensure the arg is a page before setting its padding. This is a fix for #5619 (cherry-picking from commit 493229c)
  • Loading branch information...
Scott Jehl
Scott Jehl committed Mar 29, 2013
1 parent b9bdd3c commit 4f46cd4abe0dc3380a8607b99a5c72c1c75cc13e
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/widgets/fixedToolbar.js
@@ -63,7 +63,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
$.extend( this, {
_thisPage: null
});
-
+
self._addTransitionClass();
self._bindPageEvents();
self._bindToggleHandlers();
@@ -159,7 +159,8 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
// This behavior only applies to "fixed", not "fullscreen"
if ( this.options.fullscreen ) { return; }
- tbPage = tbPage || this._thisPage || $el.closest( ".ui-page" );
+ // tbPage argument can be a Page object or an event, if coming from throttled resize.
+ tbPage = ( tbPage && tbPage.type === undefined && tbPage ) || this._thisPage || $el.closest( ".ui-page" );
$( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() + pos );
},

0 comments on commit 4f46cd4

Please sign in to comment.