{"size": 2421, "ext": "js", "max_stars_repo_path": "design/standard/lib/jquery-treemenu/1.0/js/jquery.treemenu.js", "max_stars_repo_name": "Aplyca/aplutils", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "design/standard/lib/jquery-treemenu/1.0/js/jquery.treemenu.js", "max_issues_repo_name": "Aplyca/aplutils", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "design/standard/lib/jquery-treemenu/1.0/js/jquery.treemenu.js", "max_forks_repo_name": "Aplyca/aplutils", "max_forks_repo_forks_event_min_datetime": "2019-01-30T19:47:31.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-30T19:47:31.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.4842105263, "max_line_length": 98, "alphanum_fraction": 0.4969021066}
/**
* jQuery Treemenu Plugin 1.0
*
* http://www.aplyca.com/
*
* Copyright (c) 2011 Aplyca SAS 
*/

(function($){
	$.fn.treemenu = function(options){
		var defaults = {
				deploy: 'false',
				depth: 1,
				easing: 'linear',
				duration: 0,
				event: 'click',
				callback: function(){return true;},
				bullet:{
					children: 'children',
					open: 'open',
					pointer: 'pointer'
				} 
		};
	
		options.bullet = $.extend(defaults.bullet, options.bullet);
		var options = $.extend(defaults, options);	
		
		return this.each(function(){
			var obj=$(this);
			
			obj.find("li a").click(function(e){
	        	e.stopPropagation();
	        });	
	        obj.find("li ul").click(function(e){
	        	e.stopPropagation();
	        });
	        
	        var root_depth=obj.parents().length;
	        obj.find("li").each(function(){	        	
	        	var current_depth=$(this).parents().length;	        	
	        	if($(this).children("ul").length > 0)
	        	{	
	        		if (options.deploy == 'true' && (((options.depth-1)*2) > (current_depth - root_depth)))
	        		{	        			
	        			$(this).addClass(options.bullet.children);
		        		$(this).addClass(options.bullet.open);
	        		}
	        		else
	        		{	
		        		if (((options.depth-1)*2) > (current_depth - root_depth))
		        		{	
		        			$(this).addClass(options.bullet.children);
		        		}
		        		else
		        		{
			        		$(this).removeClass(options.bullet.children);
			        		$(this).removeClass(options.bullet.open);
		        		}
	        		}
	        		
        		}
	        	
	        	if ($(this).hasClass(options.bullet.children))
	        	{
	        		$(this).addClass(options.bullet.pointer);
	        	}	
	        	
	        });

			obj.find("ul").each(function(){
				var current_depth=$(this).parent().parents().length;
				if (options.deploy == 'true')
				{
					if (((options.depth-1)*2) > (current_depth - root_depth))
					{
						$(this).show();
					}						
				}
				else
				{
					if ($(this).parent().hasClass(options.bullet.open))
					{
						$(this).show();
					}
				}
	        });
				        
			var toggle=function(event) {
				$(this).toggleClass(options.bullet.open);
	        	$(this).children("ul").slideToggle(options.duration, options.easing, options.callback );
			};
			obj.find("."+options.bullet.children).on(options.event, toggle);
		});
	};
})(jQuery);