Skip to content

Commit

Permalink
Toolbar: removing popup removes page-header-fixed class
Browse files Browse the repository at this point in the history
  • Loading branch information
cgack committed Aug 29, 2014
1 parent f7fefb9 commit 2457d2a
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions js/widgets/fixedToolbar.js
Expand Up @@ -35,6 +35,7 @@ define( [ "jquery", "../widget", "../core", "../animationComplete", "../navigati

_create: function() {
this._super();
this.pagecontainer = $( ":mobile-pagecontainer" );
if ( this.options.position === "fixed" && !this.options.supportBlacklist() ) {
this._makeFixed();
}
Expand Down Expand Up @@ -277,21 +278,29 @@ define( [ "jquery", "../widget", "../core", "../animationComplete", "../navigati
},

_destroy: function() {
var pageClasses, toolbarClasses, hasFixedChildren,
page = ( !!this.page ) ?
this.page : ( $( ".ui-page-active" ).length > 0 ) ?
$( ".ui-page-active" ) : $( ".ui-page" ).eq(0);
var pageClasses, toolbarClasses, hasFixed, header, hasFullscreen,
page = this.pagecontainer.pagecontainer( "getActivePage" );

this._super();
if ( this.options.position === "fixed" ) {
hasFixedChildren = $.mobile.document.find( ".ui-header-fixed" )
.length > 0;
toolbarClasses = "ui-header-fixed ui-footer-fixed ui-header-fullscreen in out";
toolbarClasses += " ui-footer-fullscreen fade slidedown slideup ui-fixed-hidden";
hasFixed = $( "body>.ui-" + this.role + "-fixed" )
.add( page )
.find( ".ui-" + this.options.role + "-fixed" )
.not( this.element ).length > 0;
hasFullscreen = $( "body>.ui-" + this.role + "-fixed" )
.add( page )
.find( ".ui-" + this.options.role + "-fullscreen" )
.not( this.element ).length > 0;
toolbarClasses = "ui-header-fixed ui-footer-fixed ui-header-fullscreen in out" +
" ui-footer-fullscreen fade slidedown slideup ui-fixed-hidden";
this.element.removeClass( toolbarClasses );
pageClasses = "ui-page-" + this.role + "-fullscreen";
if ( !hasFixedChildren ) {
if ( !hasFullscreen ) {
pageClasses = "ui-page-" + this.role + "-fullscreen";
}
if ( !hasFixed ) {
header = this.role === "header";
pageClasses += " ui-page-" + this.role + "-fixed";
page.css( "padding-" + ( header ? "top" : "bottom" ), "" );
}
page.removeClass( pageClasses );
}
Expand Down

0 comments on commit 2457d2a

Please sign in to comment.