PDA

View Full Version : [FIXED] [PR1] Ext.Button - iconAlign config parameter did not work



SunboX
4 Nov 2011, 4:36 AM
If I set the "iconAlign" config to "top", nothing happens. After looking at the Ext.Button code, I found the wrong line:

This should be changed:

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

if (this.getIcon()) {
element.addCls(baseCls + alignment);
}
},

to this:

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

if (this.getIconMask()) {
element.addCls(baseCls + alignment);
}
},

One more problem. If I fix the Button code, the icons are displayed in the wrog direction.

iconAlign: 'left' -> The icon is right
iconAlign: 'top' -> The icon is bottom
...

greetings Sunny

SunboX
4 Nov 2011, 4:42 AM
Second bug could be fixed like this:

Changes in _button.scss

// Button icon alignment
.x-iconalign-left, .x-icon-align-right {
@include box-orient(horizontal);
}
.x-iconalign-top, .x-iconalign-bottom {
@include box-orient(vertical);
}
.x-iconalign-bottom, .x-iconalign-right {
@include box-direction(reverse);
}
.x-iconalign-left, .x-iconalign-top {
@include box-direction(normal);
}
.x-iconalign-left .x-button-label {
margin-left: $toolbar-spacing * 1.5;
}
.x-iconalign-right .x-button-label {
margin-right: $toolbar-spacing * 1.5;
}

greetings Sunny

mitchellsimoens
4 Nov 2011, 7:26 AM
Thank you for the report.