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

Commit

Permalink
Fixed problem with isVisible check
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jan 18, 2011
1 parent 812a95c commit c30373e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 56 deletions.
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: Sat Jan 15 15:15:02 2011 +0000
* Date: Mon Jan 17 19:16:58 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
47 changes: 23 additions & 24 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: Sat Jan 15 15:15:02 2011 +0000
* Date: Mon Jan 17 19:16:58 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -201,7 +201,7 @@ function QTip(target, options, id)
}

function isVisible() {
return tooltip[0].offsetLeft !== hideOffset;
return tooltip.css('left') !== hideOffset;
}

function setWidget() {
Expand Down Expand Up @@ -875,26 +875,6 @@ function QTip(target, options, id)
self.cache.event = $.extend({}, event);
}

// Define after callback
function after()
{
// Prevent antialias from disappearing in IE by removing filter
if(state) {
if($.browser.msie) { tooltip[0].style.removeAttribute('filter'); }
}
// Hide the tooltip using negative offset and reset opacity
else {
tooltip.css({
display: '',
visibility: 'hidden',
width: '',
opacity: '',
left: '',
top: ''
});
}
}

// Call API methods
callback = $.Event('tooltip'+type);
callback.originalEvent = event ? self.cache.event : NULL;
Expand All @@ -908,7 +888,7 @@ function QTip(target, options, id)
if(state) {
tooltip.hide().css({ visibility: '' }); // Hide it first so effects aren't skipped

// Focus the tooltip and momentarily focus it via the DOM so screenreaders can read it
// Focus the tooltip
self.focus(event);

// Update tooltip position (without animation)
Expand All @@ -925,6 +905,25 @@ function QTip(target, options, id)
self.blur(event);
}

// Define post-animation state specific properties
function after() {
// Prevent antialias from disappearing in IE by removing filter
if(state) {
if($.browser.msie) { tooltip[0].style.removeAttribute('filter'); }
}
// Hide the tooltip using negative offset and reset opacity
else {
tooltip.css({
display: '',
visibility: 'hidden',
width: '',
opacity: '',
left: '',
top: ''
});
}
}

// Clear animation queue
tooltip.stop(1, 1);

Expand Down Expand Up @@ -2048,7 +2047,7 @@ function Tip(qTip, command)
// Check if border is enabled and format it
if(border > 0) {
inner = inner.eq(0);
inner.css({ left: translate[0], top: translate[1] })
inner.css({ left: Math.floor(translate[0]), top: Math.floor(translate[1]) })
.attr({ filled: FALSE, stroked: TRUE });

if(inner.html() === '') {
Expand Down
12 changes: 6 additions & 6 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

43 changes: 21 additions & 22 deletions src/core.js
Expand Up @@ -166,7 +166,7 @@ function QTip(target, options, id)
}

function isVisible() {
return tooltip[0].offsetLeft !== hideOffset;
return tooltip.css('left') !== hideOffset;
}

function setWidget() {
Expand Down Expand Up @@ -840,26 +840,6 @@ function QTip(target, options, id)
self.cache.event = $.extend({}, event);
}

// Define after callback
function after()
{
// Prevent antialias from disappearing in IE by removing filter
if(state) {
if($.browser.msie) { tooltip[0].style.removeAttribute('filter'); }
}
// Hide the tooltip using negative offset and reset opacity
else {
tooltip.css({
display: '',
visibility: 'hidden',
width: '',
opacity: '',
left: '',
top: ''
});
}
}

// Call API methods
callback = $.Event('tooltip'+type);
callback.originalEvent = event ? self.cache.event : NULL;
Expand All @@ -873,7 +853,7 @@ function QTip(target, options, id)
if(state) {
tooltip.hide().css({ visibility: '' }); // Hide it first so effects aren't skipped

// Focus the tooltip and momentarily focus it via the DOM so screenreaders can read it
// Focus the tooltip
self.focus(event);

// Update tooltip position (without animation)
Expand All @@ -890,6 +870,25 @@ function QTip(target, options, id)
self.blur(event);
}

// Define post-animation state specific properties
function after() {
// Prevent antialias from disappearing in IE by removing filter
if(state) {
if($.browser.msie) { tooltip[0].style.removeAttribute('filter'); }
}
// Hide the tooltip using negative offset and reset opacity
else {
tooltip.css({
display: '',
visibility: 'hidden',
width: '',
opacity: '',
left: '',
top: ''
});
}
}

// Clear animation queue
tooltip.stop(1, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/tips.js
Expand Up @@ -343,7 +343,7 @@ function Tip(qTip, command)
// Check if border is enabled and format it
if(border > 0) {
inner = inner.eq(0);
inner.css({ left: translate[0], top: translate[1] })
inner.css({ left: Math.floor(translate[0]), top: Math.floor(translate[1]) })
.attr({ filled: FALSE, stroked: TRUE });

if(inner.html() === '') {
Expand Down

0 comments on commit c30373e

Please sign in to comment.