From 3c009a6550fff7366c93baab4e3e9826ba04fe8f Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 4 Oct 2012 19:23:30 +0300 Subject: [PATCH] [controlgroup] Use enhanced buttonMarkup corner-encoding ability instead of setting corner classes manually -- Fixes #3635 --- js/jquery.mobile.controlGroup.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/jquery.mobile.controlGroup.js b/js/jquery.mobile.controlGroup.js index 9e7281846f5..bf20d5e6491 100644 --- a/js/jquery.mobile.controlGroup.js +++ b/js/jquery.mobile.controlGroup.js @@ -11,10 +11,11 @@ define( [ "jquery", "./jquery.mobile.buttonMarkup" ], function( $ ) { $.fn.controlgroup = function( options ) { function flipClasses( els, flCorners ) { - els.removeClass( "ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow" ) - .eq( 0 ).addClass( flCorners[ 0 ] ) + els.removeClass( "ui-controlgroup-last" ) + .buttonMarkup( { corners: false, shadow: false } ) + .eq( 0 ).buttonMarkup( { corners: flCorners[ 0 ] } ) .end() - .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" ); + .last().buttonMarkup( { corners: flCorners[ 1 ] } ).addClass( "ui-controlgroup-last" ); } return this.each(function() { @@ -28,7 +29,7 @@ $.fn.controlgroup = function( options ) { grouplegend = $el.children( "legend" ), groupheading = $el.children( ".ui-controlgroup-label" ), groupcontrols = $el.children( ".ui-controlgroup-controls" ), - flCorners = o.direction === "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ], + flCorners = o.direction === "horizontal" ? [ "left", "right" ] : [ "top", "bottom" ], type = $el.find( "input" ).first().attr( "type" ); // First unwrap the controls if the controlgroup was already enhanced @@ -49,7 +50,6 @@ $.fn.controlgroup = function( options ) { $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction ); flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not( '.ui-slider-handle' ), flCorners ); - flipClasses( $el.find( ".ui-btn-inner" ), flCorners ); if ( o.shadow ) { $el.addClass( "ui-shadow" );