tabbar, controlgroup: Check the existence of buttons in footer
authorMinkyeong Kim <minkyeong.kim@samsung.com>
Fri, 14 Jun 2013 11:58:15 +0000 (20:58 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Fri, 21 Jun 2013 06:14:17 +0000 (06:14 +0000)
Change-Id: I8f0dbbcbb742f0a1811991573b5e6dcae196b552

src/js/widgets/jquery.mobile.tizen.pagelayout.js
src/themes/tizen/common/jquery.mobile.controlgroup.less
src/themes/tizen/common/jquery.mobile.theme.less

index 2aea5b8..3c54e66 100644 (file)
@@ -391,7 +391,9 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                        var $elPage = $( thisPage ),
                                $elFooter = $elPage.find( ":jqmData(role='footer')" ),
                                $elBackKey = $elFooter.children( ".ui-btn-back" ),
-                               $elMoreKey = $elFooter.children(":jqmData(icon='naviframe-more')");
+                               $elMoreKey = $elFooter.children(":jqmData(icon='naviframe-more')"),
+                               $elTabBar = $elFooter.children( ".ui-tabbar" ),
+                               $elControlGroup = $elFooter.children( ".ui-controlgroup" );
                                //cntMore = 0,
                        
                                // Check HW Key option
@@ -424,6 +426,12 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                        if( $elBackKey ) {
                                $elBackKey.hide();
                        }
+                       if( $elTabBar ) {
+                               $elTabBar.removeClass( "ui-tabbar-margin-more ui-tabbar-margin-back" );
+                       }
+                       if ( $elControlGroup ) {
+                               $elControlGroup.removeClass( "ui-controlgroup-padding-more ui-controlgroup-padding-back" );
+                       }
                        // Case 3 : no footer - do nothing
 
                        return true;
@@ -545,6 +553,19 @@ define( [ '../jquery.mobile.tizen.core' ], function ( ) {
                                $( $.mobile.pagelayout.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
                        }
                        $.mobile.pagelayout.prototype.enhanceWithin( e.target );
+               })
+               .bind( "pagebeforeshow", function ( event, ui ) {
+                       var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ),
+                               controlgroup_filter = footer_filter.find( ":jqmData(role='controlgroup')" ),
+                               $elFooterMore = controlgroup_filter.siblings( ":jqmData(icon='naviframe-more')" ),
+                               $elFooterBack = controlgroup_filter.siblings( ".ui-btn-back" );
+
+                       if ( $elFooterMore.length ) {
+                               controlgroup_filter.addClass( "ui-controlgroup-padding-more" );
+                       }
+                       if ( $elFooterBack.length ) {
+                               controlgroup_filter.addClass( "ui-controlgroup-padding-back" );
+                       }
                });
 
 }( jQuery ));
index de405e4..ac7a05c 100644 (file)
@@ -6,6 +6,8 @@ fieldset.ui-controlgroup {
        margin: .5em 0 1em;
 }
 .ui-bar .ui-controlgroup {
+       padding-left: auto;
+       padding-right: auto;
        margin: 0 .3em;
 }
 .ui-controlgroup-label {
@@ -95,6 +97,12 @@ fieldset.ui-controlgroup {
                }
        }
 }
+.ui-controlgroup.ui-controlgroup-padding-more {
+       padding-left: 58 * @unit_base;
+}
+.ui-controlgroup.ui-controlgroup-padding-back {
+       padding-right: 58 * @unit_base;
+}
 .ui-controlgroup-vertical {
        .ui-btn, .ui-checkbox, .ui-radio {
                margin: 0;
index b1a2f4f..f17e785 100644 (file)
                margin-right : auto;
                margin-top : 6 * @unit_base; /* temp value */
                margin-bottom : 6 * @unit_base; /* temp value */
-               padding-left : 58 * @unit_base;
-               padding-right : 58 * @unit_base;
-
 
                [data-role="button"] {
                        background : transparent;