Close popup on tree menu clicks