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

Commit 3c009a6

Browse files
author
Gabriel Schulhof
committed
[controlgroup] Use enhanced buttonMarkup corner-encoding ability instead of setting corner classes manually -- Fixes #3635
1 parent be1e872 commit 3c009a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

js/jquery.mobile.controlGroup.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ define( [ "jquery", "./jquery.mobile.buttonMarkup" ], function( $ ) {
1111

1212
$.fn.controlgroup = function( options ) {
1313
function flipClasses( els, flCorners ) {
14-
els.removeClass( "ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow" )
15-
.eq( 0 ).addClass( flCorners[ 0 ] )
14+
els.removeClass( "ui-controlgroup-last" )
15+
.buttonMarkup( { corners: false, shadow: false } )
16+
.eq( 0 ).buttonMarkup( { corners: flCorners[ 0 ] } )
1617
.end()
17-
.last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
18+
.last().buttonMarkup( { corners: flCorners[ 1 ] } ).addClass( "ui-controlgroup-last" );
1819
}
1920

2021
return this.each(function() {
@@ -28,7 +29,7 @@ $.fn.controlgroup = function( options ) {
2829
grouplegend = $el.children( "legend" ),
2930
groupheading = $el.children( ".ui-controlgroup-label" ),
3031
groupcontrols = $el.children( ".ui-controlgroup-controls" ),
31-
flCorners = o.direction === "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
32+
flCorners = o.direction === "horizontal" ? [ "left", "right" ] : [ "top", "bottom" ],
3233
type = $el.find( "input" ).first().attr( "type" );
3334

3435
// First unwrap the controls if the controlgroup was already enhanced
@@ -49,7 +50,6 @@ $.fn.controlgroup = function( options ) {
4950
$el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction );
5051

5152
flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not( '.ui-slider-handle' ), flCorners );
52-
flipClasses( $el.find( ".ui-btn-inner" ), flCorners );
5353

5454
if ( o.shadow ) {
5555
$el.addClass( "ui-shadow" );

0 commit comments

Comments
 (0)