Page MenuHomePhabricator

Tipsy: using user class borks positioning of tip
Closed, ResolvedPublic

Description

patch to file jquery.tipsy.js

Tipsy allows adding a user class for specific tips.

one of the uses of this feature is to change the dimensions of the tip: e.g., when you want to display more in the tip, sometimes the default max-width (25em on mw deployments) may not be enough, and you want to use, say, 35em.

so you can open the tip with "className: wideTip" in teh options, and then add to your css something like

.tipsy.wideTip, .tipsy.wideTip tipsy-inner { max-width: 35em; }

this scheme works, but the problem is that tipsy adds the user class *after* it calculates the tip's dimensions (so the dimensions are calculated with the default class), so when you go through these motions, the tip ends up in the wrong place: it's upper left corner will be in the right place for the tall-and-thin default tip, but the tip itself becomes shorter-and-wider (if the gravity is "south", this will cause the tip to float too high above the element, basically missing the whole point of widening the tip to make it shorter)

the fix is very simple: add the user class immediately after resetting the tip class in function show(), instead of after the location calculation.

patch attached.

peace.


Version: 1.23.0
Severity: normal

Attached:

Details

Reference
bz57144

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:16 AM
bzimport set Reference to bz57144.

Change 95822 had a related patch set uploaded by Matanya:
(bug 57144) Tipsy: using user class borks positioning of tip

https://gerrit.wikimedia.org/r/95822

Change 95822 had a related patch set uploaded by Hashar:
(bug 57144) Tipsy: using user class borks positioning of tip

https://gerrit.wikimedia.org/r/95822

any news? we are somewhat stuck here - this patch is waiting for some reviews for a while.

peace.

Change 95822 merged by Trevor Parscal:
tipsy: using user class borks positioning of tip

https://gerrit.wikimedia.org/r/95822

This merge seems to resolve the issue. Thanks.