Skip to content

Ticket 6981 - Merge offset options into my and at options #136

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

Closed
wants to merge 3 commits into from
Closed

Ticket 6981 - Merge offset options into my and at options #136

wants to merge 3 commits into from

Conversation

Adovenmuehle
Copy link
Contributor

Merged offset options into my and at options. Used in conjunction they give more functionality than previously.

Take a look and let me know what you think, I refactored a good bit of the position code, hopefully it's easier to follow now.

-Alex

position.top -= elemHeight / 2;
}

// prevent fractions (see #5280)
position.left = Math.round( position.left );
position.top = Math.round( position.top );
position.left = Math.round( ( position.left - ( options.my.horizontal.offset.calculate( position.left ) - position.left ) ) );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change this to
position.left = Math.round( options.my.horizontal.offset.calculate( position.left ) );
It will work where "my" offsets act like the old offsets and made { my: 'left+50 bottom+50', at: 'left bottom' } equal to { my: 'left bottom', at: 'left+50 bottom+50' }

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

Successfully merging this pull request may close these issues.

2 participants