clean legend code for desktop
mobile popups