| 1250 | } |
| 1251 | |
| 1252 | function hideMethod(event) { |
| 1253 | if(this.tooltip.hasClass(CLASS_DISABLED)) { return FALSE; } |
| 1254 | |
| 1255 | // Check if new target was actually the tooltip element |
| 1256 | var relatedTarget = $(event.relatedTarget), |
| 1257 | ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0], |
| 1258 | ontoTarget = relatedTarget[0] === this.options.show.target[0]; |
| 1259 | |
| 1260 | // Clear timers and stop animation queue |
| 1261 | clearTimeout(this.timers.show); |
| 1262 | clearTimeout(this.timers.hide); |
| 1263 | |
| 1264 | // Prevent hiding if tooltip is fixed and event target is the tooltip. |
| 1265 | // Or if mouse positioning is enabled and cursor momentarily overlaps |
| 1266 | if(this !== relatedTarget[0] && |
| 1267 | (this.options.position.target === 'mouse' && ontoTooltip) || |
| 1268 | (this.options.hide.fixed && ( |
| 1269 | (/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget)) |
| 1270 | )) |
| 1271 | { |
| 1272 | try { |
| 1273 | event.preventDefault(); |
| 1274 | event.stopImmediatePropagation(); |
| 1275 | } catch(e) {} |
| 1276 | |
| 1277 | return; |
| 1278 | } |
| 1279 | |
| 1280 | // If tooltip has displayed, start hide timer |
| 1281 | var callback = $.proxy(function(){ this.toggle(FALSE, event); }, this); |
| 1282 | if(this.options.hide.delay > 0) { |
| 1283 | this.timers.hide = setTimeout(callback, this.options.hide.delay); |
| 1284 | } |
| 1285 | else{ callback(); } |
| 1286 | } |
| 1287 | |
| 1288 | function inactiveMethod(event) { |
| 1289 | if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return FALSE; } |