#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: | ||
Blocked by: | Blocking: |
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 (11)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
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 9 years ago by
Summary: | css marker at position-element, which direction it was flipped → Position: Add ability to determine if the element is flipped |
---|
comment:5 Changed 9 years ago by
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 8 years ago by
Added a commit for this: https://github.com/bmsterling/jquery-ui/commit/6420e57e84cc8aa13b6d529b6d9e86830780fc88
comment:7 Changed 8 years ago by
Milestone: | TBD → 1.9 |
---|---|
Priority: | minor → major |
Status: | new → open |
comment:8 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
comment:9 Changed 7 years ago by
Was this ever released? I can't seem to find it anywhere in the code nor documentation..
comment:10 Changed 7 years ago by
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 7 years ago by
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.