button class change breaks icon only buttons
|Reported by:||nefiga@…||Owned by:|
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:2 Changed 6 years ago by Scott González
- Resolution set to fixed
- Status changed from new to closed