View Full Version : [FIXED] [PR 1] Button -> iconAlign

16 Oct 2011, 6:08 AM
hi team,

not working for me! i tried

iconAlign : top

inside the config-object or direct, the icon always renders at the left side.

16 Oct 2011, 8:13 AM
not sure if this fix is perfect, but it will point you into the right direction.

first: iconCls does count (not only icon):

updateIconAlign: function(alignment, oldAlignment) {
var element = this.element,
baseCls = Ext.baseCSSPrefix + 'iconalign-';

element.removeCls(baseCls + oldAlignment);
if (this.getIcon() || this.getIconCls()) {
element.addCls(baseCls + alignment);

but this messes up the css a bit more. the following class was valid for ST 1.x:

.x-iconalign-left, .x-iconalign-top {
-webkit-box-direction: reverse;
box-direction: reverse;

in ST 2, it changes left to right and top to bottom.

so with replacing it to:

.x-iconalign-left, .x-iconalign-top {
-webkit-box-direction: normal;
box-direction: normal;

i get quite close.

9 Nov 2011, 4:29 PM
That just about fixed it. I just needed to add a little extra polish to allow for center aligned icons (when there is no text).