Ticket #5937 (closed feature: fixed)
Position: Add ability to determine if the element is flipped
| Reported by: | T.Lindig | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.9.0 |
| Component: | ui.position | Version: | 1.8.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
For my tooltip implementation i need to know, if the positioned element was flipped or better in which direction it is shown. So it would be helpful, if the positions-plugin could add a css marker on his element depending on the calculated position top, left, right or bottom.
In according to the my-option may be a combination of css-classes like this:
ui-position-my-bottom ui-position-my-left
or
ui-position-my-top ui-position-my-right
Change History
comment:2 Changed 3 years ago by T.Lindig
removing older classes when repositioning is not difficulty, if we remove ever all the additional classes before we repositioning. my be that is not the solution with the best performance, but it would be easy and clean.
comment:3 Changed 2 years ago by scott.gonzalez
- Summary changed from css marker at position-element, which direction it was flipped to Position: Add ability to determine if the element is flipped
comment:5 Changed 2 years ago by collin
Design wise this would be extremely useful. For example, in using position on elements that have directional design pieces, such as an arrow. One must know side the positioned element is on.
I mentioned this the other month on the forums too (I must have overlooked this ticket): http://forum.jquery.com/topic/position-api-redesign#14737000002025210
comment:6 Changed 23 months ago by bmsterling
Added a commit for this: https://github.com/bmsterling/jquery-ui/commit/6420e57e84cc8aa13b6d529b6d9e86830780fc88
comment:7 Changed 19 months ago by scott.gonzalez
- Priority changed from minor to major
- Status changed from new to open
- Milestone changed from TBD to 1.9
comment:8 Changed 13 months ago by joern.zaefferer
- Status changed from open to closed
- Resolution set to fixed
comment:9 Changed 3 months ago by meyertee
Was this ever released? I can't seem to find it anywhere in the code nor documentation..
comment:10 Changed 3 months ago by scott.gonzalez
As the ticket milestone says, it was released in 1.9.0. It's documented in the position API page (see the using parameter) and was fully documented in the 1.9 upgrade guide. The comment immediately before yours also lists the commit in which the code was added.
comment:11 Changed 3 months ago by meyertee
Oh sorry, I got confused.. so it was implemented with an argument to the using function. Brilliant, I was looking for the wrong thing.


Providing feedback about the positioning result is definitely a good idea. We've got the using-callback, but that requires to implement the actual positioning to work. We could add a info-only callback, or something like additional classes. The latter poses the difficulty of removing older classes when repositioning.