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

New: Draw annotations UI #403

Merged
merged 4 commits into from
Sep 25, 2017
Merged

New: Draw annotations UI #403

merged 4 commits into from
Sep 25, 2017

Conversation

jeremypress
Copy link
Contributor

Tests incoming

*/
replaceHeader(replacementHeader) {
// First hide all possible headers
this.container.querySelectorAll(`.${CLASS_HIDDEN}`).forEach((element) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean to add CLASS_HIDDEN to all elements that have CLASS_HIDDEN?
Shouldn't this just be selecting the header element and hiding it, if it exists?

right: 10px;
}

.bp-btn-annotate-draw-undo,
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you don't have :hover, :active, and :focus?
I'm just curious as to why those are included

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to override the normal button styles since they assume things like background/border for all of these states. The undo redo buttons are an svg in a clear button. I considered not using `'bp-btn' but we gain convenience with the disabled state, cursor, and using the correct hit box.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tonyjin have you dealt with anything like this before?

Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tried using 'bp-btn-plain`?

I'd do something like class="bp-btn bp-btn-plain bp-btn-annotate-draw-undo" - not sure if you need both bp-btn and bp-btn-plain

.replace(/\W*(\w)\w*/g, '$1')
.toUpperCase()
.substring(0, 3);
initials = userName.replace(/\W*(\w)\w*/g, '$1').toUpperCase().substring(0, 3);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for record, we're planning on moving away from initials, and moving towards colours and symbols

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was prettier, I didn't touch this line.

@jeremypress jeremypress merged commit 4cbfc0f into box:master Sep 25, 2017
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