Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement Request: Smarter Placement When Every Placement Yields a Collision #99

Open
speedplane opened this issue Aug 5, 2013 · 2 comments
Labels
Feature Software improvements that involve implementing new features.

Comments

@speedplane
Copy link

Hi again,

As I mentioned in an earlier issue, some of my pages use very large tooltips (hover over Google and Oracle to see them). The smartPlacement feature is great, but it fails to work very well when every placement yields at least one collision. In the link above, when you hover over Google, no matter where you place the tooltip there will be at least one collision.

However, even where there must be a collision, some placements are more preferable to others. For example, if there must be a collision, then one would prefer the tooltip to be placed in such a way that the user could scroll the screen to see the entire tooltip. That way, even though the tooltip collides with the viewport, it does not collide with the browser window.

I put together a solution, by adding a new collision type that gets set when the tooltip falls outside of the browser window (as opposed to falling outside the viewport). When we're looking for the best placement, it selects the placement with either no viewport collisions, or if none exists the placement with no browser collisions.

My solution is located here

@speedplane
Copy link
Author

Here is a screenshot with the problem:

image

And here it is after applying my fix:

image

@stevenbenner
Copy link
Owner

This might be a duplicate of issue #30. I've saved a copy of your modified version, I'll take a look at how your code works when I get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Software improvements that involve implementing new features.
Projects
None yet
Development

No branches or pull requests

2 participants