Skip to content

Commit 493229c

Browse files
author
Scott Jehl
committed
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 jquery-archive#5619
1 parent 71001d1 commit 493229c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/widgets/fixedToolbar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
6363
$.extend( this, {
6464
_thisPage: null
6565
});
66-
66+
6767
self._addTransitionClass();
6868
self._bindPageEvents();
6969
self._bindToggleHandlers();
@@ -159,7 +159,8 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
159159
// This behavior only applies to "fixed", not "fullscreen"
160160
if ( this.options.fullscreen ) { return; }
161161

162-
tbPage = tbPage || this._thisPage || $el.closest( ".ui-page" );
162+
// tbPage argument can be a Page object or an event, if coming from throttled resize.
163+
tbPage = ( tbPage && tbPage.type === undefined && tbPage ) || this._thisPage || $el.closest( ".ui-page" );
163164
$( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() + pos );
164165
},
165166

0 commit comments

Comments
 (0)