if navbar is expanded (mobile) then collapse it by simulating a click