Naviframe : hide backbutton in case SIP up(remove backbutton makes problem in binding...
[platform/framework/web/web-ui-fw.git] / src / js / widgets / jquery.mobile.tizen.pagelayout.js
index 83df532..49bc11f 100644 (file)
@@ -242,16 +242,24 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                });
 
                        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 );
+
                        });
                },
 
@@ -271,9 +279,16 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                $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" );
                },
@@ -319,7 +334,9 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                $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')" );
@@ -335,7 +352,12 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                $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 -
@@ -367,6 +389,12 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                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 );
                }
        });