Search and Top Navigation
#7040 closed bug (fixed)
Opened February 26, 2011 02:26AM UTC
Closed February 26, 2011 10:14AM UTC
Last modified March 15, 2011 01:58PM UTC
button class change breaks icon only buttons
Reported by: | nefiga@hotmail.com | 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!
Attachments (0)
Change History (8)
Changed February 26, 2011 09:49AM UTC by comment:1
Changed February 26, 2011 10:14AM UTC by comment:2
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
Changed February 26, 2011 10:15AM UTC by comment:3
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
Changed February 26, 2011 10:16AM UTC by comment:4
milestone: | 1.9 → 1.8.11 |
---|
also reported in the forum: http://forum.jquery.com/topic/bug-in-icon-only-button