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

Commit

Permalink
Fixed tip colour bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Nov 1, 2011
1 parent a4e57d6 commit 71d8b11
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion 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: Tue Nov 1 21:06:49 2011 +0000
* Date: Tue Nov 1 21:07:13 2011 +0000
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
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: Tue Nov 1 21:06:49 2011 +0000
* Date: Tue Nov 1 21:07:13 2011 +0000
*/

/* Core qTip styles */
Expand Down
12 changes: 6 additions & 6 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 Nov 1 21:06:49 2011 +0000
* Date: Tue Nov 1 21:07:13 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 @@ -2895,10 +2895,10 @@ function Tip(qTip, command)
return self.corner.string() !== 'centercenter';
},

detectColours: function() {
detectColours: function(actual) {
var i, fill, border,
tip = elems.tip.css({ backgroundColor: '', border: '' }),
corner = self.corner,
tip = elems.tip.css('cssText', ''),
corner = actual || self.corner,
precedance = corner[ corner.precedance ],

borderSide = 'border-' + precedance + '-color',
Expand Down Expand Up @@ -2931,7 +2931,7 @@ function Tip(qTip, command)
}
if(!border || invalid.test(border) || border === bodyBorder) {
color.border = colorElem.css(borderSide) || transparent;
if(invalid.test(color.border) || color.border === contentColour) {
if(invalid.test(color.border)) {
color.border = border;
}
}
Expand Down Expand Up @@ -2998,7 +2998,7 @@ function Tip(qTip, command)
precedance = mimic.precedance;

// Update our colours
self.detectColours();
self.detectColours(corner);

// Detect border width, taking into account colours
if(color.border !== 'transparent' && color.border !== '#123456') {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/tips/tips.js
Expand Up @@ -269,10 +269,10 @@ function Tip(qTip, command)
return self.corner.string() !== 'centercenter';
},

detectColours: function() {
detectColours: function(actual) {
var i, fill, border,
tip = elems.tip.css({ backgroundColor: '', border: '' }),
corner = self.corner,
tip = elems.tip.css('cssText', ''),
corner = actual || self.corner,
precedance = corner[ corner.precedance ],

borderSide = 'border-' + precedance + '-color',
Expand Down Expand Up @@ -305,7 +305,7 @@ function Tip(qTip, command)
}
if(!border || invalid.test(border) || border === bodyBorder) {
color.border = colorElem.css(borderSide) || transparent;
if(invalid.test(color.border) || color.border === contentColour) {
if(invalid.test(color.border)) {
color.border = border;
}
}
Expand Down Expand Up @@ -372,7 +372,7 @@ function Tip(qTip, command)
precedance = mimic.precedance;

// Update our colours
self.detectColours();
self.detectColours(corner);

// Detect border width, taking into account colours
if(color.border !== 'transparent' && color.border !== '#123456') {
Expand Down

0 comments on commit 71d8b11

Please sign in to comment.