});
window.addEventListener( "softkeyboardchange", function ( e ) {
- var thisPage = $( ".ui-page-active" );
-
- if ( e.state == "on" ) {
- $elCurrentFooter = $( ".ui-page-active .ui-footer" );
- $elCurrentFooter.hide();
- } else if (e.state == "off") {
- $elCurrentFooter.show();
+ var $elDownBtn = $( "<div class='ui-btn-footer-down'></div>" ),
+ $elPage = $( ".ui-page-active" ),
+ backBtnPosition = "footer";
+
+ if ( $elPage.data( "addBackBtn" ) ) {
+ $elPage.data( "addBackBtn" ) == "header" ? backBtnPosition = "header" : backBtnPosition = "footer";
+
+ if ( e.state == "on" ) {
+ if ( !$elPage.find( ".ui-" + backBtnPosition + " .ui-btn-footer-down" ).length ) {
+ $elDownBtn.buttonMarkup( { icon: "down" } ).appendTo( $elPage.find( ".ui-" + backBtnPosition ) );
+ }
+ $( ".ui-page-active .ui-btn-back" ).hide();
+ } else if ( e.state == "off" ) {
+ $( ".ui-page-active .ui-btn-back" ).show();
+ $( ".ui-btn-footer-down" ).remove();
+ }
}
- self.updatePagePadding( thisPage );
- self.updatePageLayout( thisPage, true );
+
});
},
$elHeader = $elPage.find( ":jqmData(role='header')" ),
$elFooter = $elPage.find( ":jqmData(role='footer')" ),
$elContent = $elPage.find( ":jqmData(role='content')" ),
- resultMinHeight;
+ resultMinHeight,
+ dpr = 1,
+ layoutInnerHeight = window.innerHeight;
+
+ if ( !$.support.scrollview ) {
+ dpr = window.outerWidth / window.innerWidth;
+ layoutInnerHeight = Math.floor( window.outerHeight / dpr );
+ }
- resultMinHeight = window.innerHeight - $elHeader.height() - $elFooter.height();
+ resultMinHeight = layoutInnerHeight - $elHeader.height() - $elFooter.height();
$elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
},
$elContent = $elPage.find( ":jqmData(role='content')" ),
resultContentHeight = 0,
resultFooterHeight = 0,
- resultHeaderHeight = 0;
+ resultHeaderHeight = 0,
+ layoutInnerHeight = window.innerHeight,
+ dpr = 1;
if ( $elPage.length ) {
$elFooter = $elPage.find( ":jqmData(role='footer')" );
$elFooter.css( "bottom", 0 );
}
- resultContentHeight = window.innerHeight - resultFooterHeight - resultHeaderHeight;
+ if ( !$.support.scrollview ) {
+ dpr = window.outerWidth / window.innerWidth;
+ layoutInnerHeight = Math.floor( window.outerHeight / dpr );
+ }
+
+ resultContentHeight = layoutInnerHeight - resultFooterHeight - resultHeaderHeight;
if ( $.support.scrollview ) {
$elContent.height( resultContentHeight -
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" );
+ },
+
+ refresh: function () {
+ var $elPage = $( ".ui-page-active" );
+ this.setHeaderFooter( $elPage );
+ this._updateHeaderArea( $elPage );
}
});