Fixed hide issue in Internet Explorer

The color selection popup element doesn't hide correctly in Internet Explorer.
When you click on the icon to show it, then click somewhere to hide it, the click on 'anywhere' will toggle the display of that element.

This fix adds an extra if check to make it only hide when the element is visible.

### Testing instructions
Either create a module or view that uses the ```<field name="color" type="color" control="simple" ... />``` form element.
Or simply test with Advanced Module Manager (http://www.nonumber.nl/extensions/advancedmodulemanager) that uses this element in the views.
Then play around with it in Internet Explorer.