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

Commit

Permalink
Fixed tip canvas colour issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed May 9, 2011
1 parent bd6c090 commit e34e454
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 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: Mon May 9 00:36:47 2011 +0100
* Date: Mon May 9 00:37:46 2011 +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
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 May 9 00:36:47 2011 +0100
* Date: Mon May 9 00:37:46 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
16 changes: 9 additions & 7 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 May 9 00:36:47 2011 +0100
* Date: Mon May 9 00:37:46 2011 +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 @@ -2235,21 +2235,23 @@ function Tip(qTip, command)
tooltip.addClass(fluid);

// Detect tip colours from CSS styles
fill = tip.css(backgroundColor) || transparent;
border = tip[0].style[ borderSideCamel ];
fill = tip.css(backgroundColor);
border = tip[0].style[ borderSideCamel ] || tooltip.css(borderSide);

// Make sure colours are valid
if(!fill || invalid.test(fill)) {
color.fill = colorElem.css(backgroundColor);
color.fill = colorElem.css(backgroundColor) || transparent;
if(invalid.test(color.fill)) {
color.fill = tooltip.css(backgroundColor) || fill;
}
}
if(!border || invalid.test(border)) {
color.border = tooltip.css(borderSide);
color.border = tooltip.css(borderSide) || transparent;
if(invalid.test(color.border) || color.border === bodyBorder) {
color.border = colorElem.css(borderSide);
if(color.border === contentColour) { color.border = border; }
color.border = colorElem.css(borderSide) || transparent;
if(color.border === contentColour || invalid.test(color.border)) {
color.border = border;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions src/tips.js
Expand Up @@ -284,21 +284,23 @@ function Tip(qTip, command)
tooltip.addClass(fluid);

// Detect tip colours from CSS styles
fill = tip.css(backgroundColor) || transparent;
border = tip[0].style[ borderSideCamel ];
fill = tip.css(backgroundColor);
border = tip[0].style[ borderSideCamel ] || tooltip.css(borderSide);

// Make sure colours are valid
if(!fill || invalid.test(fill)) {
color.fill = colorElem.css(backgroundColor);
color.fill = colorElem.css(backgroundColor) || transparent;
if(invalid.test(color.fill)) {
color.fill = tooltip.css(backgroundColor) || fill;
}
}
if(!border || invalid.test(border)) {
color.border = tooltip.css(borderSide);
color.border = tooltip.css(borderSide) || transparent;
if(invalid.test(color.border) || color.border === bodyBorder) {
color.border = colorElem.css(borderSide);
if(color.border === contentColour) { color.border = border; }
color.border = colorElem.css(borderSide) || transparent;
if(color.border === contentColour || invalid.test(color.border)) {
color.border = border;
}
}
}

Expand Down

0 comments on commit e34e454

Please sign in to comment.