Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Ensure hide.leave works by using blur along with mouseout
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Nov 21, 2011
1 parent 8762f5c commit af8d88c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
7 changes: 4 additions & 3 deletions dist/jquery.qtip.basic.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Nov 17 20:02:58 2011 +0000
* Date: Mon Nov 21 17:39:37 2011 +0000
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -529,7 +529,7 @@ function QTip(target, options, id, attr)
if(/mouse(out|leave)/i.test(options.hide.event)) {
// Hide tooltips when leaving current window/frame (but not select/option elements)
if(options.hide.leave === 'window') {
targets.window.bind('mouseout' + namespace, function(event) {
targets.window.bind('mouseout'+namespace+' blur'+namespace, function(event) {
if(/select|option/.test(event.target) && !event.relatedTarget) { self.hide(event); }
});
}
Expand Down Expand Up @@ -1753,7 +1753,8 @@ PLUGINS = QTIP.plugins = {
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
var f = corner.charAt(0); this.precedance = (f === 't' || f === 'b' ? 'y' : 'x');

this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
this.abbrev = function() {
var x = this.x.substr(0,1), y = this.y.substr(0,1);
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Nov 17 20:02:58 2011 +0000
* Date: Mon Nov 21 17:39:37 2011 +0000
*/

/* Core qTip styles */
Expand Down
7 changes: 4 additions & 3 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Nov 17 20:02:58 2011 +0000
* Date: Mon Nov 21 17:39:37 2011 +0000
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -529,7 +529,7 @@ function QTip(target, options, id, attr)
if(/mouse(out|leave)/i.test(options.hide.event)) {
// Hide tooltips when leaving current window/frame (but not select/option elements)
if(options.hide.leave === 'window') {
targets.window.bind('mouseout' + namespace, function(event) {
targets.window.bind('mouseout'+namespace+' blur'+namespace, function(event) {
if(/select|option/.test(event.target) && !event.relatedTarget) { self.hide(event); }
});
}
Expand Down Expand Up @@ -1753,7 +1753,8 @@ PLUGINS = QTIP.plugins = {
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
var f = corner.charAt(0); this.precedance = (f === 't' || f === 'b' ? 'y' : 'x');

this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
this.abbrev = function() {
var x = this.x.substr(0,1), y = this.y.substr(0,1);
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/core.js
Expand Up @@ -466,7 +466,7 @@ function QTip(target, options, id, attr)
if(/mouse(out|leave)/i.test(options.hide.event)) {
// Hide tooltips when leaving current window/frame (but not select/option elements)
if(options.hide.leave === 'window') {
targets.window.bind('mouseout' + namespace, function(event) {
targets.window.bind('mouseout'+namespace+' blur'+namespace, function(event) {
if(/select|option/.test(event.target) && !event.relatedTarget) { self.hide(event); }
});
}
Expand Down Expand Up @@ -1690,7 +1690,8 @@ PLUGINS = QTIP.plugins = {
this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();

this.precedance = (corner.charAt(0).search(/^(t|b)/) > -1) ? 'y' : 'x';
var f = corner.charAt(0); this.precedance = (f === 't' || f === 'b' ? 'y' : 'x');

this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
this.abbrev = function() {
var x = this.x.substr(0,1), y = this.y.substr(0,1);
Expand Down

0 comments on commit af8d88c

Please sign in to comment.