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

Commit

Permalink
Fixed problem with tip colour detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Dec 8, 2010
1 parent 56f51a8 commit 064b55c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 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: Wed Dec 8 18:53:54 2010 +0000
* Date: Wed Dec 8 19:03:35 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
9 changes: 5 additions & 4 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: Wed Dec 8 18:53:54 2010 +0000
* Date: Wed Dec 8 19:03:35 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 @@ -1934,15 +1934,16 @@ function Tip(qTip, command)
precedance = self.corner[ self.corner.precedance ],
borderSide = 'border-' + precedance + '-color',
invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i,
reference = elems.titlebar.length && self.corner.y === 'top' ? elems.titlebar : qTip.options.style.widget ? elems.content : elems.wrapper;
elemFill = elems.titlebar.length && corner.y === 'top' ? elems.titlebar : elems.wrapper,
elemBorder = qTip.options.style.widget ? elems.content : elems.wrapper;

// Detect tip colours
color.fill = tip.css('background-color', '').css('border', '').css('background-color') || 'transparent';
color.border = tip.get(0).style ? tip.get(0).style['border' + precedance.charAt(0) + precedance.substr(1) + 'Color'] : tip.css(borderSide) || 'transparent';

// Make sure colours are valid and reset background and border properties
if(invalid.test(color.fill)) { color.fill = reference.css(border ? 'background-color' : borderSide); }
if(!color.border || invalid.test(color.border)) { color.border = reference.css(borderSide) || color.fill; }
if(invalid.test(color.fill)) { color.fill = elemFill.css(border ? 'background-color' : borderSide); }
if(!color.border || invalid.test(color.border)) { color.border = elemBorder.css(borderSide) || color.fill; }

$('*', tip).add(tip).css('background-color', 'transparent').css('border', 0);
},
Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/tips.js
Expand Up @@ -239,15 +239,16 @@ function Tip(qTip, command)
precedance = self.corner[ self.corner.precedance ],
borderSide = 'border-' + precedance + '-color',
invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i,
reference = elems.titlebar.length && self.corner.y === 'top' ? elems.titlebar : qTip.options.style.widget ? elems.content : elems.wrapper;
elemFill = elems.titlebar.length && corner.y === 'top' ? elems.titlebar : elems.wrapper,
elemBorder = qTip.options.style.widget ? elems.content : elems.wrapper;

// Detect tip colours
color.fill = tip.css('background-color', '').css('border', '').css('background-color') || 'transparent';
color.border = tip.get(0).style ? tip.get(0).style['border' + precedance.charAt(0) + precedance.substr(1) + 'Color'] : tip.css(borderSide) || 'transparent';

// Make sure colours are valid and reset background and border properties
if(invalid.test(color.fill)) { color.fill = reference.css(border ? 'background-color' : borderSide); }
if(!color.border || invalid.test(color.border)) { color.border = reference.css(borderSide) || color.fill; }
if(invalid.test(color.fill)) { color.fill = elemFill.css(border ? 'background-color' : borderSide); }
if(!color.border || invalid.test(color.border)) { color.border = elemBorder.css(borderSide) || color.fill; }

$('*', tip).add(tip).css('background-color', 'transparent').css('border', 0);
},
Expand Down

0 comments on commit 064b55c

Please sign in to comment.