mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
bde431bb44
Ref gh-1528
37 lines
561 B
JavaScript
37 lines
561 B
JavaScript
define( [
|
|
"jquery",
|
|
"lib/helper"
|
|
], function( $, helper ) {
|
|
|
|
var lastItem,
|
|
log = [];
|
|
|
|
return $.extend( helper, {
|
|
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" );
|
|
}
|
|
} );
|
|
|
|
} );
|