Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6046 from jzaefferer/move-resetactivepageheight-n…
Browse files Browse the repository at this point in the history
…av-core-5997

Move $.mobile.resetActivePageHeight from navigation to core. Fixes #5997...
  • Loading branch information
arschmitz committed May 29, 2013
2 parents 58a1073 + b39787b commit 7d4e5e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 11 additions & 0 deletions js/jquery.mobile.core.js
Expand Up @@ -246,6 +246,17 @@ define( [ "jquery", "./jquery.mobile.ns", "json!../package.json" ], function( jQ
// Native innerHeight returns more accurate value for this across platforms,
// jQuery version is here as a normalized fallback for platforms like Symbian
return window.innerHeight || $.mobile.window.height();
},

//simply set the active page's minimum height to screen height, depending on orientation
resetActivePageHeight: function( height ) {
var aPage = $( "." + $.mobile.activePageClass ),
aPageHeight = aPage.height(),
aPageOuterHeight = aPage.outerHeight( true );

height = ( typeof height === "number" ) ? height : $.mobile.getScreenHeight();

aPage.css( "min-height", height - ( aPageOuterHeight - aPageHeight ) );
}
});

Expand Down
13 changes: 0 additions & 13 deletions js/jquery.mobile.navigation.js
Expand Up @@ -97,8 +97,6 @@ define( [
//initial value. If a base tag does not exist, then we default to the documentUrl.
documentBase = path.documentBase,

getScreenHeight = $.mobile.getScreenHeight,

//base element management, defined depending on dynamic base tag support
base = {
//define base element, for use in routing asset urls that are referenced in Ajax-requested markup
Expand Down Expand Up @@ -307,17 +305,6 @@ define( [
return promise;
}

//simply set the active page's minimum height to screen height, depending on orientation
$.mobile.resetActivePageHeight = function resetActivePageHeight( height ) {
var aPage = $( "." + $.mobile.activePageClass ),
aPageHeight = aPage.height(),
aPageOuterHeight = aPage.outerHeight( true );

height = ( typeof height === "number" ) ? height : getScreenHeight();

aPage.css( "min-height", height - ( aPageOuterHeight - aPageHeight ) );
};

//shared page enhancements
function enhancePage( $page, role ) {
// If a role was specified, make sure the data-role attribute
Expand Down

0 comments on commit 7d4e5e1

Please sign in to comment.