Craga89/qTip2 — Issue #308: unfocus event should be bound to document, not document.body.
Author: mark-rushakoff
Created: 2012-02-07 03:11:51+00:00
State: open

[Here's a fiddle](http://jsfiddle.net/MarkRushakoff/PGRHe/1/) (forked from one of yours) that uses `{hide: "unfocus"}`. As you will see, clicking inside the box dismisses the qTip, but clicking outside (above or below) the box does not dismiss the qTip.

The apparent fix is to change [this line](https://github.com/Craga89/qTip2/blob/41e9a84060723bf380fabe6b7cd988a6377fa7f6/src/core.js#L488) from

targets.body.bind('mousedown'+namespace, function(event) {

to

targets.document.bind('mousedown'+namespace, function(event) {

This actually affects my current project at work, where a short page has a qTip near the bottom; clicking under the qTip didn't dismiss it, as the fiddle demonstrated.

Is there any reason it wasn't `targets.document` in the first place?