Permalink
Browse files

fixedToolbar: added logic to set page padding back to 0 on destroy. F…

…ixed #5261 - When you call destroy on the fixedToolbar widget it does not restore page padding
  • Loading branch information...
arschmitz committed Nov 8, 2012
1 parent c7dd675 commit 43eddf2f08c789d28bab77701bda216533010190
Showing with 6 additions and 2 deletions.
  1. +6 −2 js/widgets/fixedToolbar.js
@@ -260,8 +260,12 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
},
destroy: function() {
this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
var $el = this.element,
header = $el.is( ".ui-header" );
$el.closest( '.ui-page' ).css( "padding-" + ( header ? "top" : "bottom" ), 0 );
$el.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
$el.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
}
});

0 comments on commit 43eddf2

Please sign in to comment.