Fixes a performance issue with Firefox related to hide on click 

When running the date picker in Firefox, every single click in the window calls scope.$apply(), even when
the date picker isn't visible.  This causes firefox to slow WAY down.

This change makes sure that scope.$apply() only is called on click when the date picker is visible.