Update js/bootstrap-datepicker.js

If programmers use the class 'datepicker' to select the elements that should have the datepicker, then under certain conditions the datepicker opens up multiple times. This patch should fix that.
Only run hide function if picker is visible

Fixes #310