File: helper.js

package info (click to toggle)
jqueryui 1.12.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,800 kB
  • sloc: php: 584; xml: 104; makefile: 75
file content (36 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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" );
	}
} );

} );