PDA

View Full Version : [CLOSED] Incorrect CSS selector in SplitButton's showMenuArrow



M0ns1gn0r
24 Jan 2013, 6:42 PM
REQUIRED INFORMATION


Ext version tested:

Ext 4.2.0 Beta 2
Browser versions tested against:

IE10 preview
DOCTYPE tested against:

<!DOCTYPE html>
Description:

When I call hideMenuArrow() function of SplitButton, this function works as expected - it hides the arrow. But when I call showMenuArrow() - nothing happens, the arrow button does not appear.
Steps to reproduce the problem:

Call splitButton.hideMenuArrow()
Call splitButton.showMenuArrow()
The result that was expected:

Arrow hides
Arrow appears again
The result that occurs instead:

Arrow hides
Arrow stays hidden
Test Case:



function TestArrow(splitButton)
{
splitButton.hideMenuArrow();
splitButton.showMenuArrow();
}




HELPFUL INFORMATION

Debugging already done:

I've analyzed code of both functions and found out that showMenuArrow contains incorrect CSS selector. It is "td em", which is too specific. The "em" tag lies inside a "div", not a "td".

Possible fix:



Ext.define('FixesSplitButton', {
override: 'Ext.Button',
showMenuArrow: function ()
{
var el = this.el.down("em");

if (!Ext.isEmpty(el))
{
el.addCls("x-btn-" + this.arrowCls + "-" + this.arrowAlign);
el.addCls("x-btn-" + this.arrowCls);
}
}
});


Operating System:

Window 7 x64

mitchellsimoens
25 Jan 2013, 9:58 AM
There isn't a showMenuArrow or a hideMenuArrow method in the framework or documentation

M0ns1gn0r
26 Jan 2013, 2:08 AM
I am sorry, it appears this code is a part of Ext.NET, not Ext.JS.