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

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed some IE VML tip position issues and also fixed bug that was cau…
…sing positioning to take into warpper border even if no tip border was enabled
  • Loading branch information
Craga89 committed Dec 6, 2010
1 parent 95f3ce4 commit e16aa8d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 45 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: Mon Dec 6 18:42:59 2010 +0000
* Date: Mon Dec 6 19:26:58 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
22 changes: 12 additions & 10 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: Mon Dec 6 18:42:59 2010 +0000
* Date: Mon Dec 6 19:26:58 2010 +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 @@ -1813,17 +1813,17 @@ function Tip(qTip, command)

// Determine secondary adjustments
offset = size[ (precedance === 'x') ? 'width' : 'height' ];
if(method === 'vml' && (/bottom|right/).test(corner[ corner.precedance ])) {
offset += 1;
}

// Adjust to border width
if(border) {
tooltip.toggleClass('ui-tooltip-accessible', !tooltip.is(':visible'));
offset -= parseInt(wrapper.css('border-' + corner[ precedance ] + '-width'), 10) || 0;
tooltip.removeClass('ui-tooltip-accessible');
}

// VML adjustments
if(method === 'vml' && (/bottom|right/).test(corner[ corner.precedance ])) {
offset += border ? 1 : -1;
}

// Adjust secondary corners
tip.css(corner[precedance], -offset);
}
Expand All @@ -1834,8 +1834,7 @@ function Tip(qTip, command)
var newCorner = $.extend({}, self.corner),
precedance = newCorner.precedance === 'y' ? ['y', 'top', 'left', 'height', 'x'] : ['x', 'left', 'top', 'width', 'y'],
adjusted = pos.adjusted,
offset = [ parseInt(wrapper.css('border-' + newCorner[ precedance[0] ] + '-width'), 10) || 0, 0 ],
walk = [newCorner];
offset = [0, 0];

// Adjust tip corners
if(adjusted.left) {
Expand All @@ -1845,9 +1844,12 @@ function Tip(qTip, command)
newCorner.y = newCorner.y === 'center' ? (adjusted.top > 0 ? 'top' : 'bottom') : (newCorner.y === 'top' ? 'bottom' : 'top');
}

// Adjust tooltip pos if needed in relation to tip element
// Setup offset adjustments
offset[0] = border ? parseInt(wrapper.css('border-' + newCorner[ precedance[0] ] + '-width'), 10) || 0 : 0;
offset[1] = Math.max(newCorner[ precedance[4] ] === 'center' ? opts.offset : 0, opts.offset);
pos[ precedance[1] ] += (newCorner[ precedance[0] ] === precedance[1] ? 1 : -1) * (size[ precedance[3] ] - offset[0]) - ((method === 'vml') ? 1 : 0);

// Adjust tooltip position in relation to tip element
pos[ precedance[1] ] += (newCorner[ precedance[0] ] === precedance[1] ? 1 : -1) * (size[ precedance[3] ] - offset[0]);
pos[ precedance[2] ] -= (newCorner[ precedance[4] ] === precedance[2] || newCorner[ precedance[4] ] === 'center' ? 1 : -1) * offset[1];

// Update and redraw the tip if needed
Expand Down

0 comments on commit e16aa8d

Please sign in to comment.