samples/app/src/main/webapp/resources/js/jquery.simpletreeview.js
// callback (optional): function to call back after toggle
callback (optional): function to call back after toggle
callback ( optional ) : function to call back after toggle
function toggle($ul, method, callback) {
			if(callback === undefined) callback = function(){};
			var $handle = $ul.parent("li").children("span.handle");
			if(method == "open") {
				$handle.html(settings.open);
				if(settings.slide) { $ul.slideDown(settings.speed, callback); }
				else { $ul.show(); callback(); }
			}
			else if(method == "close") {
				$handle.html(settings.close);
				if(settings.slide) { $ul.slideUp(settings.speed, callback); }
				else { $ul.hide(); callback(); }
			}
			else {		
					$handle.html($ul.is(':hidden') ? settings.open : settings.close);
					if(settings.slide) { $ul.slideToggle(settings.speed, callback); }
					else { $ul.toggle(); callback(); }
			}
		}
function toggle ( $ul , method , callback ) { if ( callback === undefined ) callback = function ( ) { } ; var $handle = $ul . parent ( "li" ) . children ( "span.handle" ) ; if ( method == "open" ) { $handle . html ( settings . open ) ; if ( settings . slide ) { $ul . slideDown ( settings . speed , callback ) ; } else { $ul . show ( ) ; callback ( ) ; } } else if ( method == "close" ) { $handle . html ( settings . close ) ; if ( settings . slide ) { $ul . slideUp ( settings . speed , callback ) ; } else { $ul . hide ( ) ; callback ( ) ; } } else { $handle . html ( $ul . is ( ':hidden' ) ? settings . open : settings . close ) ; if ( settings . slide ) { $ul . slideToggle ( settings . speed , callback ) ; } else { $ul . toggle ( ) ; callback ( ) ; } } }
callback (optional): function to call back after toggle
callback ( optional ) : function to call back after toggle
// Set callback to empty function if undefined