function searchFocus() {
		if ( dropDown.style.display !== "none" ) {
			return;
		}

		dropDown.style.display = "block";
		addEvent( document, "click", hideHandler );
		addEvent( document, "keydown", hideHandler );

		// Hide on Escape keydown or outside-container click
		function hideHandler( e )  {
			var inContainer = moduleFilter.contains( e.target );

			if ( e.keyCode === 27 || !inContainer ) {
				if ( e.keyCode === 27 && inContainer ) {
					moduleSearch.focus();
				}
				dropDown.style.display = "none";
				removeEvent( document, "click", hideHandler );
				removeEvent( document, "keydown", hideHandler );
				moduleSearch.value = "";
				searchInput();
			}
		}
	}
// Enables show/hide for the dropdown
Enables show/hide for the dropdown
Enables show / hide for the dropdown
function searchFocus() {
		if ( dropDown.style.display !== "none" ) {
			return;
		}
		dropDown.style.display = "block";
		addEvent( document, "click", hideHandler );
		addEvent( document, "keydown", hideHandler );
		function hideHandler( e )  {
			var inContainer = moduleFilter.contains( e.target );
			if ( e.keyCode === 27 || !inContainer ) {
				if ( e.keyCode === 27 && inContainer ) {
					moduleSearch.focus();
				}
				dropDown.style.display = "none";
				removeEvent( document, "click", hideHandler );
				removeEvent( document, "keydown", hideHandler );
				moduleSearch.value = "";
				searchInput();
			}
		}
	}
function searchFocus ( ) { if ( dropDown . style . display !== "none" ) { return ; } dropDown . style . display = "block" ; addEvent ( document , "click" , hideHandler ) ; addEvent ( document , "keydown" , hideHandler ) ; function hideHandler ( e ) { var inContainer = moduleFilter . contains ( e . target ) ; if ( e . keyCode === 27 || ! inContainer ) { if ( e . keyCode === 27 && inContainer ) { moduleSearch . focus ( ) ; } dropDown . style . display = "none" ; removeEvent ( document , "click" , hideHandler ) ; removeEvent ( document , "keydown" , hideHandler ) ; moduleSearch . value = "" ; searchInput ( ) ; } } }
Enables show/hide for the dropdown
Enables show / hide for the dropdown
// Hide on Escape keydown or outside-container click