webapp/src/main/webapp/lib/commons.js
/**
 * Close the dropdown if the user clicks outside of it.
 * 
 * @since 0.3.0
 */
Close the dropdown if the user clicks outside of it.


Close the dropdown if the user clicks outside of it .
function initDropDown() {
	window.onclick = function(event) {
		if (!event.target.matches('.drop-button')) {
			var dropdowns = document.getElementsByClassName("dropdown-content");
			var i;
			for (i = 0; i < dropdowns.length; i++) {
				var openDropdown = dropdowns[i];
				if (openDropdown.classList.contains('show')) {
					openDropdown.classList.remove('show');
				}
			}
		}
	}
}
function initDropDown ( ) { window . onclick = function ( event ) { if ( ! event . target . matches ( '.drop-button' ) ) { var dropdowns = document . getElementsByClassName ( "dropdown-content" ) ; var i ; for ( i = 0 ; i < dropdowns . length ; i ++ ) { var openDropdown = dropdowns [ i ] ; if ( openDropdown . classList . contains ( 'show' ) ) { openDropdown . classList . remove ( 'show' ) ; } } } } }
Close the dropdown if the user clicks outside of it.
Close the dropdown if the user clicks outside of it .