Update tooltip.js

Fix to issue #2785.