Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7040 closed bug (fixed)

button class change breaks icon only buttons

Reported by: [email protected] Owned by:
Priority: minor Milestone: 1.8.11
Component: ui.button Version: 1.8.10
Keywords: Cc:
Blocked by: Blocking:

Description

new jquery 1.8.10 has a problem with the multiple classes change for buttons (https://github.com/jquery/jquery-ui/commit/d6fa44a0b4c5bf08f31040f9008e8fb54b36db02).

I can see the problem in the code here:

buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); buttonElement.removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" );

Problem is, now that .push() is being used instead of .addClass(), the .removeClass() doesn't remove, for example, the ui-button-text-icon-primary class from an icon only button, because it hasn't been added yet. This results in the icon being off-center. To fix, maybe move the .removeClass call down below to after the classes have been added so it's properly removed, or else splice the buttonClasses array to get rid of the offending classes? I'm sure you'll come up with a better idea.

Thanks for the great product!

Change History (8)

comment:1 Changed 12 years ago by Scott González

comment:2 Changed 12 years ago by Scott González

Resolution: fixed
Status: newclosed

Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons.

Changeset: e72afe4afca0795fc785114cfeafbe08f5e2fdf3

comment:3 Changed 12 years ago by Scott González

Button: Only add text classes if there is text. Fixes #7040 - button class change breaks icon only buttons. (cherry picked from commit e72afe4afca0795fc785114cfeafbe08f5e2fdf3)

Changeset: c9bbd9aa6e8bd23e314f4e284aec3b18c6ad797c

comment:4 Changed 12 years ago by Scott González

Milestone: 1.91.8.11

comment:5 Changed 12 years ago by rdworth

#7038 is a duplicate of this ticket

comment:6 Changed 12 years ago by Scott González

#7099 is a duplicate of this ticket.

comment:7 Changed 12 years ago by Scott González

#7097 is a duplicate of this ticket.

comment:8 Changed 12 years ago by rdworth

#7116 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.