2015-04-07 14:30:07 +00:00
|
|
|
define( [
|
|
|
|
"jquery",
|
|
|
|
"lib/helper"
|
|
|
|
], function( $, helper ) {
|
2012-06-18 17:26:46 +00:00
|
|
|
|
|
|
|
var lastItem,
|
|
|
|
log = [];
|
|
|
|
|
2015-04-07 14:30:07 +00:00
|
|
|
return $.extend( helper, {
|
2012-04-19 16:19:52 +00:00
|
|
|
log: function( message, clear ) {
|
|
|
|
if ( clear ) {
|
2012-06-18 17:26:46 +00:00
|
|
|
log.length = 0;
|
2012-04-19 16:19:52 +00:00
|
|
|
}
|
|
|
|
if ( message === undefined ) {
|
2012-06-18 17:26:46 +00:00
|
|
|
message = lastItem;
|
2012-04-19 16:19:52 +00:00
|
|
|
}
|
2012-06-18 17:38:16 +00:00
|
|
|
log.push( $.trim( message ) );
|
2012-06-18 17:26:46 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
logOutput: function() {
|
2012-06-18 17:38:16 +00:00
|
|
|
return log.join( "," );
|
2012-06-18 17:26:46 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
clearLog: function() {
|
|
|
|
log.length = 0;
|
2012-04-19 16:19:52 +00:00
|
|
|
},
|
2011-08-04 01:15:38 +00:00
|
|
|
|
2012-04-19 16:19:52 +00:00
|
|
|
click: function( menu, item ) {
|
2012-06-18 17:26:46 +00:00
|
|
|
lastItem = item;
|
2014-10-25 16:18:17 +00:00
|
|
|
menu.children( ":eq(" + item + ")" )
|
|
|
|
.children( ".ui-menu-item-wrapper" )
|
|
|
|
.trigger( "click" );
|
2012-04-19 16:19:52 +00:00
|
|
|
}
|
2015-04-07 14:30:07 +00:00
|
|
|
} );
|
2012-06-18 17:26:46 +00:00
|
|
|
|
2015-04-06 17:04:04 +00:00
|
|
|
} );
|