#7040 closed bug (fixed)
button class change breaks icon only buttons
Reported by: | 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
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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
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
Milestone: | 1.9 → 1.8.11 |
---|
also reported in the forum: http://forum.jquery.com/topic/bug-in-icon-only-button