Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix tooltip positioning. #119

Open
wants to merge 1 commit into from

2 participants

@ADmad

Based on the extra class added to the outermost div I am changing the size of div with class .tipsy-inner. eg. .myclass.tipsy .tipsy-inner { max-width:300px;}. Currently the tooltip is wrongly positioned because the position calculation is done before applying the class. This patch fixes the issue.

@CloCkWeRX

Duplicate of #88 and #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 12, 2012
  1. @ADmad
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/javascripts/jquery.tipsy.js
View
6 src/javascripts/jquery.tipsy.js
@@ -32,6 +32,9 @@
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
+ if (this.options.className) {
+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
+ }
var pos = $.extend({}, this.$element.offset(), {
width: this.$element[0].offsetWidth,
@@ -68,9 +71,6 @@
$tip.css(tp).addClass('tipsy-' + gravity);
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
- if (this.options.className) {
- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
- }
if (this.options.fade) {
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
Something went wrong with that request. Please try again.