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

Commit

Permalink
Removed some redundant code to allow translucent tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Aug 19, 2010
1 parent a6c7243 commit 99eaf3c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 63 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: Tue Aug 17 19:25:35 2010 +0100
* Date: Tue Aug 17 19:40:39 2010 +0100
*/

.ui-tooltip-accessible{
Expand Down
21 changes: 9 additions & 12 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: Tue Aug 17 19:25:35 2010 +0100
* Date: Tue Aug 17 19:40:39 2010 +0100
*/

"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 @@ -695,30 +695,28 @@ function QTip(target, options, id)
// Define after callback
function after()
{
var attr = state ? 'attr' : 'removeAttr';

// Reset opacity to avoid bugs
$(this).css({ opacity: '', height: '' });
var attr = state ? 'attr' : 'removeAttr',
opacity = (/^1|0$/).test($(this).css('opacity'));

// Apply ARIA attributes when tooltip is shown
if(self.elements.title){ target[attr]('aria-labelledby', 'ui-tooltip-'+id+'-title'); }
target[attr]('aria-describedby', 'ui-tooltip-'+id+'-content');

// Prevent antialias from disappearing in IE7 by removing filter and opacity attribute
if(state) {
if($.browser.msie && $(this).get(0).style) {
if($.browser.msie && $(this).get(0).style && opacity) {
ieStyle = $(this).get(0).style;
ieStyle.removeAttribute('filter');
ieStyle.removeAttribute('opacity');
}
}
else {
else if(opacity) {
$(this).hide();
}
}

// Return if element is already in correct state
if((visible && state) || (!visible && !state) || tooltip.is(':animated')) { return self; }
if((!visible && !state) || tooltip.is(':animated')) { return self; }

// Attempt to prevent 'blinking' effect when tooltip and show target overlap
if(event) {
Expand Down Expand Up @@ -750,9 +748,8 @@ function QTip(target, options, id)
if(opts.solo) { $(':not(.qtip.ui-tooltip)').qtip('hide'); }
}
else {
// Clear timeout and reset opacity
clearTimeout(self.timers.show); // Clear show timer
tooltip.css({ opacity: '' }); // Reset opacity
// Clear show timer
clearTimeout(self.timers.show);
}

// Set ARIA hidden status attribute
Expand All @@ -764,7 +761,7 @@ function QTip(target, options, id)
// Use custom function if provided
if($.isFunction(opts.effect)) {
opts.effect.call(tooltip);
tooltip.queue(function(){ after.call(this);$ (this).dequeue(); });
tooltip.queue(function(){ after.call(this); $(this).dequeue(); });
}

// If no effect type is supplied, use a simple toggle
Expand Down

0 comments on commit 99eaf3c

Please sign in to comment.