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 position.effect not being called
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 6, 2011
1 parent 6ed8f67 commit 1538c5b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 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: Mon Apr 4 17:51:01 2011 +0100
* Date: Mon Apr 4 18:39:49 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
19 changes: 9 additions & 10 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 Apr 4 17:51:01 2011 +0100
* Date: Mon Apr 4 18:39:49 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 @@ -885,8 +885,8 @@ function QTip(target, options, id, attr)
// Focus the tooltip
self.focus(event);

// Update tooltip position (without animation)
self.reposition(event, 0);
// Update tooltip position
self.reposition(event);

// Hide other tooltips if tooltip is solo, using it as the context
if(opts.solo) { $(selector, opts.solo).not(tooltip).qtip('hide', callback); }
Expand Down Expand Up @@ -1072,7 +1072,7 @@ function QTip(target, options, id, attr)
return position.top - posTop;
}
};
effect = effect === undefined || !!effect || FALSE;
effect = effect === undefined || !!effect;

// Cache our viewport details
viewport = !viewport ? FALSE : {
Expand Down Expand Up @@ -1175,18 +1175,17 @@ function QTip(target, options, id, attr)
delete position.adjusted;

// If effect is disabled or positioning gives NaN out, set CSS directly
if(!effect || !isNaN(position.left, position.top)) {
if(!effect || isNaN(position.left) || isNaN(position.top)) {
tooltip.css(position);
}

// Use custom function if provided
else if(tooltip.is(':visible') && $.isFunction(posOptions.effect)) {
posOptions.effect.call(tooltip, self, position);
else if($.isFunction(posOptions.effect)) {
posOptions.effect.call(tooltip, self, $.extend({}, position));
tooltip.queue(function(next) {
var elem = $(this);
// Reset attributes to avoid cross-browser rendering bugs
elem.css({ opacity: '', height: '' });
if($.browser.msie && this.style) { this.style.removeAttribute('filter'); }
$(this).css({ opacity: '', height: '' });
if($.browser.msie) { this.style.removeAttribute('filter'); }

next();
});
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.

17 changes: 8 additions & 9 deletions src/core.js
Expand Up @@ -843,8 +843,8 @@ function QTip(target, options, id, attr)
// Focus the tooltip
self.focus(event);

// Update tooltip position (without animation)
self.reposition(event, 0);
// Update tooltip position
self.reposition(event);

// Hide other tooltips if tooltip is solo, using it as the context
if(opts.solo) { $(selector, opts.solo).not(tooltip).qtip('hide', callback); }
Expand Down Expand Up @@ -1030,7 +1030,7 @@ function QTip(target, options, id, attr)
return position.top - posTop;
}
};
effect = effect === undefined || !!effect || FALSE;
effect = effect === undefined || !!effect;

// Cache our viewport details
viewport = !viewport ? FALSE : {
Expand Down Expand Up @@ -1133,18 +1133,17 @@ function QTip(target, options, id, attr)
delete position.adjusted;

// If effect is disabled or positioning gives NaN out, set CSS directly
if(!effect || !isNaN(position.left, position.top)) {
if(!effect || isNaN(position.left) || isNaN(position.top)) {
tooltip.css(position);
}

// Use custom function if provided
else if(tooltip.is(':visible') && $.isFunction(posOptions.effect)) {
posOptions.effect.call(tooltip, self, position);
else if($.isFunction(posOptions.effect)) {
posOptions.effect.call(tooltip, self, $.extend({}, position));
tooltip.queue(function(next) {
var elem = $(this);
// Reset attributes to avoid cross-browser rendering bugs
elem.css({ opacity: '', height: '' });
if($.browser.msie && this.style) { this.style.removeAttribute('filter'); }
$(this).css({ opacity: '', height: '' });
if($.browser.msie) { this.style.removeAttribute('filter'); }

next();
});
Expand Down

0 comments on commit 1538c5b

Please sign in to comment.