jquery-ui/tests/unit/menu/menu_test_helpers.js
TJ VanToll de2ef2a585 Menu: Wrap menu items in a <div>
This avoids styling issues where ui-state-focus rules apply to submenus.

Fixes #10162
Closes gh-1342
2014-10-25 10:10:30 -07:00

34 lines
506 B
JavaScript

(function() {
var lastItem,
log = [];
TestHelpers.menu = {
log: function( message, clear ) {
if ( clear ) {
log.length = 0;
}
if ( message === undefined ) {
message = lastItem;
}
log.push( $.trim( message ) );
},
logOutput: function() {
return log.join( "," );
},
clearLog: function() {
log.length = 0;
},
click: function( menu, item ) {
lastItem = item;
menu.children( ":eq(" + item + ")" )
.children( ".ui-menu-item-wrapper" )
.trigger( "click" );
}
};
})();