Skip to content
This repository

Fix tooltip positioning. #119

Open
wants to merge 1 commit into from

2 participants

ADmad Daniel O'Connor
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.

Daniel O'Connor

Duplicate of #88 and #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 12, 2012
ADmad ADmad Add extra class before calculating tooltip position f07b844
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 src/javascripts/jquery.tipsy.js
6 src/javascripts/jquery.tipsy.js
@@ -32,6 +32,9 @@
32 32 $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
33 33 $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
34 34 $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
  35 + if (this.options.className) {
  36 + $tip.addClass(maybeCall(this.options.className, this.$element[0]));
  37 + }
35 38
36 39 var pos = $.extend({}, this.$element.offset(), {
37 40 width: this.$element[0].offsetWidth,
@@ -68,9 +71,6 @@
68 71
69 72 $tip.css(tp).addClass('tipsy-' + gravity);
70 73 $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
71   - if (this.options.className) {
72   - $tip.addClass(maybeCall(this.options.className, this.$element[0]));
73   - }
74 74
75 75 if (this.options.fade) {
76 76 $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.