Permalink
Browse files

[controlgroup] Moving flipClasses() into the widget following a sugge…

…stion by johnbender
  • Loading branch information...
gabrielschulhof committed Nov 2, 2012
1 parent 69f27da commit 2a9f344c87c79260a044fc2b4443668d335d9830
Showing with 9 additions and 9 deletions.
  1. +9 −9 js/widgets/controlgroup.js
View
@@ -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,
@@ -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 );
@@ -93,7 +93,7 @@ define( [ "jquery",
corners = ( this.options.type === "horizontal" ? [ "left", "right" ] : [ "top", "bottom" ] );
}
flipClasses( els, corners );
this._flipClasses( els, corners );
}
});

0 comments on commit 2a9f344

Please sign in to comment.