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 problem with tips positioning caused by previous commits
  • Loading branch information
Craga89 committed Aug 10, 2010
1 parent a996856 commit 4e878bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core.js
Expand Up @@ -839,7 +839,7 @@ function QTip(target, options, id)
if(overflowLeft > 0 && !(posLeft >= targetLeft && posLeft < targetLeft + targetWidth)) {
position.left += newOffset - atOffset;
}
else if(overflowRight > 0 && !(posLeft < targetLeft + targetWidth && posLeft <= targetLeft)) {
else if(overflowRight > 0 && posLeft + elemWidth > targetLeft) {
position.left += my.x === 'center' ? -newOffset + atOffset : newOffset - atOffset;
}

Expand Down
15 changes: 10 additions & 5 deletions src/tips.js
Expand Up @@ -46,12 +46,20 @@ function Tip(qTip, command)
self.corner = NULL;
self.mimic = NULL;
self.checks = {
'^position.my|style.tip.(corner|mimic|method|border)': function() {
'^position\.my|style.tip.(corner|mimic|method|border)': function() {
// Re-determine tip type and update
border = opts.border;

// Make sure a tip can be drawn
self.init();
if(self.detectCorner()) {
// Create a new tip
self.create();
detectColours();
self.update();
}
else {
self.tip.remove();
}

// Only update the position if mouse isn't the target
if(this.get('position.target') !== 'mouse') {
Expand Down Expand Up @@ -209,9 +217,6 @@ function Tip(qTip, command)
// Bind update events
tooltip.bind('tooltipmove.tip', reposition);
}
else {
self.destroy();
}

return self;
},
Expand Down

0 comments on commit 4e878bf

Please sign in to comment.