Added logic to hide layer on item selected or other place is clicked
Added handling of event on global DOM