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

Commit

Permalink
[controlgroup] Moving flipClasses() into the widget following a sugge…
Browse files Browse the repository at this point in the history
…stion by johnbender
  • Loading branch information
Gabriel Schulhof committed Nov 2, 2012
1 parent 69f27da commit 2a9f344
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/widgets/controlgroup.js
Expand Up @@ -12,14 +12,6 @@ define( [ "jquery",
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

function flipClasses( els, flCorners ) {
els.removeClass( "ui-controlgroup-last" )
.buttonMarkup( { corners: false, shadow: false } )
.eq( 0 ).buttonMarkup( { corners: flCorners[ 0 ], cornerstyle: "group" } )
.end()
.last().buttonMarkup( { corners: flCorners[ 1 ], cornerstyle: "group" } ).addClass( "ui-controlgroup-last" );
}

$.widget( "mobile.controlgroup", $.mobile.widget, {
options: {
shadow: false,
Expand Down Expand Up @@ -56,6 +48,14 @@ define( [ "jquery",
this.refresh();
},

_flipClasses: function( els, flCorners ) {
els.removeClass( "ui-controlgroup-last" )
.buttonMarkup( { corners: false, shadow: false } )
.eq( 0 ).buttonMarkup( { corners: flCorners[ 0 ], cornerstyle: "group" } )
.end()
.last().buttonMarkup( { corners: flCorners[ 1 ], cornerstyle: "group" } ).addClass( "ui-controlgroup-last" );
},

_setOption: function( key, value ) {
var setter = "_set" + key.charAt( 0 ).toUpperCase() + key.slice( 1 );

Expand Down Expand Up @@ -93,7 +93,7 @@ define( [ "jquery",
corners = ( this.options.type === "horizontal" ? [ "left", "right" ] : [ "top", "bottom" ] );
}

flipClasses( els, corners );
this._flipClasses( els, corners );
}
});

Expand Down

0 comments on commit 2a9f344

Please sign in to comment.