close legends by clicking anywhere in the document