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

Fix: Create highlight dialog is misaligned on first highlight #159

Merged
merged 4 commits into from
Apr 6, 2018

Conversation

pramodsum
Copy link
Contributor

@pramodsum pramodsum commented Apr 3, 2018

No description provided.

@boxcla
Copy link

boxcla commented Apr 3, 2018

Verified that @pramodsum has signed the CLA. Thanks for the pull request!

* @param {HTMLElement} dialogEl - Annotation dialog element
* @return {number} Annotations dialog width
*/
export function getDialogWidth(dialogEl) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that it was like this before, but is there a reason for hiding/showing the dialog so many times in this function? There may be a lot of layout recalculation going on when making these calls, and even the possibility of incorrect values being returned

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm so I think the reason this was done this way was so that we could get the entire dialog width and accurately position the dialog before we actually display it. Then we wouldn't have the dialog shown and THEN repositioned correctly.

I could definitely see how it could cause some recalculations. I am open to suggestions on how to optimize this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JustinHoldstock any thoughts on how to improve this?

@pramodsum pramodsum merged commit d4d4fdd into box:master Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants