Skip to content

Commit

Permalink
apparently removed some earlier bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizec committed Jul 12, 2009
1 parent 958aca7 commit 9af2065
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions js/jquery.styledButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$.fn.styledButton = function ( params )
{
$(this).each( function ()
return $(this).each( function ()
{
var tempParams = $.extend( {}, params );
var button = new styledButton( $(this), tempParams );
Expand All @@ -22,10 +22,13 @@ function styledButton( element, params )
this.inlineBlock = ( this.oldFirefox ) ? '-moz-inline-block' : 'inline-block';
this.inParams = params;
this.params = this.setupDefaultParams( params );
this.info = this.init();

this.bordersAndBackground();
this.setupRole();
if ( !this.element.hasClass( this.params.cssClass ) )
{
this.info = this.init();
this.bordersAndBackground();
this.setupRole();
}
}

styledButton.prototype.setupDefaultParams = function ( params )
Expand Down Expand Up @@ -493,11 +496,11 @@ styledButton.prototype.hideDropdown = function ()
}
if ( element.is( this.params.dropdown.element ) )
{
for ( var i = 0; i < $(element).size(); i += 1 )
for ( var i = 0; i < element.size(); i += 1 )
{
if ( $(element).eq( i ).is( this.params.dropdown.element ) )
if ( element.eq( i ).is( this.params.dropdown.element ) )
{
$(element).eq( i ).css({ "display" : "none" });
element.eq( i ).css({ "display" : "none" });
}
}
}
Expand Down Expand Up @@ -558,9 +561,9 @@ styledButton.prototype.setupDropDown = function ()
{
for ( var i = 0; i < $(element).size(); i += 1 )
{
if ( $(element).eq( i ).is( this.params.dropdown.element ) )
if ( element.eq( i ).is( this.params.dropdown.element ) )
{
$(element).eq( i ).addClass( "dropdown" )
element.eq( i ).addClass( "dropdown" )
.css( {
'display' : 'none',
'position' : 'absolute',
Expand Down Expand Up @@ -588,11 +591,11 @@ styledButton.prototype.setupRoleSelect = function ()

if ( element.is( params.dropdown.element ) )
{
for ( var i = 0; i < $(element).size(); i += 1 )
for ( var i = 0; i < element.size(); i += 1 )
{
if ( $(element).eq( i ).is( this.params.dropdown.element ) )
if ( element.eq( i ).is( this.params.dropdown.element ) )
{
$(element).eq( i ).children().click( function () {
element.eq( i ).children().click( function () {
var value = $(this).attr( "value" );
if ( typeof( value ) != "string" )
{
Expand Down

0 comments on commit 9af2065

Please sign in to comment.