Mise à jour librairie QTip

This commit is contained in:
Michael RICOIS 2011-11-04 13:18:37 +00:00
parent 9252c442b6
commit c138fcbccf
3 changed files with 15 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License * http://en.wikipedia.org/wiki/GNU_General_Public_License
* *
* Date: Sun Oct 2 09:21:22.0000000000 2011 * Date: Tue Nov 1 14:06:07.0000000000 2011
*/ */
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */ /*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
@ -438,6 +438,7 @@ function QTip(target, options, id, attr)
hide: options.hide.target, hide: options.hide.target,
viewport: $(posOptions.viewport), viewport: $(posOptions.viewport),
document: $(document), document: $(document),
body: $(document.body),
window: $(window) window: $(window)
}, },
events = { events = {
@ -550,11 +551,11 @@ function QTip(target, options, id, attr)
// Hide tooltip on document mousedown if unfocus events are enabled // Hide tooltip on document mousedown if unfocus events are enabled
if(('' + options.hide.event).indexOf('unfocus') > -1) { if(('' + options.hide.event).indexOf('unfocus') > -1) {
targets.document.bind('mousedown'+namespace, function(event) { targets.body.bind('mousedown'+namespace, function(event) {
var $target = $(event.target), var $target = $(event.target),
enabled = !tooltip.hasClass(disabled) && tooltip.is(':visible'); enabled = !tooltip.hasClass(disabled) && tooltip.is(':visible');
if($target[0] !== tooltip[0] && $target.parents(selector).length === 0 && $target.add(target).length > 1 && !$target.is(':disabled')) { if($target[0] !== tooltip[0] && $target.parents(selector).length === 0 && $target.add(target).length > 1 && !$target.attr('disabled')) {
self.hide(event); self.hide(event);
} }
}); });
@ -2494,10 +2495,10 @@ function Tip(qTip, command)
return self.corner.string() !== 'centercenter'; return self.corner.string() !== 'centercenter';
}, },
detectColours: function() { detectColours: function(actual) {
var i, fill, border, var i, fill, border,
tip = elems.tip.css({ backgroundColor: '', border: '' }), tip = elems.tip.css('cssText', ''),
corner = self.corner, corner = actual || self.corner,
precedance = corner[ corner.precedance ], precedance = corner[ corner.precedance ],
borderSide = 'border-' + precedance + '-color', borderSide = 'border-' + precedance + '-color',
@ -2506,6 +2507,7 @@ function Tip(qTip, command)
invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i, invalid = /rgba?\(0, 0, 0(, 0)?\)|transparent/i,
backgroundColor = 'background-color', backgroundColor = 'background-color',
transparent = 'transparent', transparent = 'transparent',
important = ' !important',
bodyBorder = $(document.body).css('color'), bodyBorder = $(document.body).css('color'),
contentColour = qTip.elements.content.css('color'), contentColour = qTip.elements.content.css('color'),
@ -2519,7 +2521,7 @@ function Tip(qTip, command)
// Detect tip colours from CSS styles // Detect tip colours from CSS styles
color.fill = fill = tip.css(backgroundColor); color.fill = fill = tip.css(backgroundColor);
color.border = border = tip[0].style[ borderSideCamel ] || tip.css(borderSide) || tooltip.css(borderSide); color.border = border = tip[0].style[ borderSideCamel ] || tip.css(borderSide) || tooltip.css(borderSide);
// Make sure colours are valid // Make sure colours are valid
if(!fill || invalid.test(fill)) { if(!fill || invalid.test(fill)) {
color.fill = colorElem.css(backgroundColor) || transparent; color.fill = colorElem.css(backgroundColor) || transparent;
@ -2529,13 +2531,13 @@ function Tip(qTip, command)
} }
if(!border || invalid.test(border) || border === bodyBorder) { if(!border || invalid.test(border) || border === bodyBorder) {
color.border = colorElem.css(borderSide) || transparent; color.border = colorElem.css(borderSide) || transparent;
if(invalid.test(color.border) || color.border === contentColour) { if(invalid.test(color.border)) {
color.border = border; color.border = border;
} }
} }
// Reset background and border colours // Reset background and border colours
$('*', tip).add(tip).css(backgroundColor, transparent).css('border', ''); $('*', tip).add(tip).css('cssText', backgroundColor+':'+transparent+important+';border:0'+important+';');
// Remove fluid class // Remove fluid class
tooltip.removeClass(fluidClass); tooltip.removeClass(fluidClass);
@ -2596,7 +2598,7 @@ function Tip(qTip, command)
precedance = mimic.precedance; precedance = mimic.precedance;
// Update our colours // Update our colours
self.detectColours(); self.detectColours(corner);
// Detect border width, taking into account colours // Detect border width, taking into account colours
if(color.border !== 'transparent' && color.border !== '#123456') { if(color.border !== 'transparent' && color.border !== '#123456') {

View File

@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License * http://en.wikipedia.org/wiki/GNU_General_Public_License
* *
* Date: Sun Oct 2 09:21:22.0000000000 2011 * Date: Tue Nov 1 14:06:07.0000000000 2011
*/ */
/* Core qTip styles */ /* Core qTip styles */