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

Update/1038 freeform block add more drawer #1153

Merged
merged 18 commits into from
Jun 16, 2017

Conversation

BoardJames
Copy link

@BoardJames BoardJames commented Jun 13, 2017

This pull request adds the ability of toolbar items to have children (which allows menus) and it uses this to implement a basic more-drawer (aka kitchen sink, aka ellipse menu) for the freeform block.
more-drawer

Still to do:

@BoardJames
Copy link
Author

I have updated the more-drawer to add the arrow in the mockup and to handle the sticky behaviour better.

When there is sufficient space it displays above.
more-drawer-above

But if you scroll down and it can't fit then it displays below.
more-drawer-below

@BoardJames BoardJames requested review from jasmussen and aduth June 14, 2017 05:32
break;
}
blockControls = blockControls.parentElement;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What element are we trying to get here? Could we use element.closest() instead of looping like this (We just need to include the polyfill import 'element-closest';?

Copy link
Author

Choose a reason for hiding this comment

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

I considered element.closest() but dismissed it because IE does not support it. I didn't know that the polyfill was available.

Copy link
Author

Choose a reason for hiding this comment

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

I have updated to use the polyfill.

<Toolbar controls={ this.mapControls( MORE_CONTROLS ) } />
</div>
),
} ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we consolidate the two <BlockControls> usage and the <Fill name="Formatting.Toolbar"> into a unique <BlockControls>?

Something like

<BlockControls>
  <Toolbar />
  <Toolbar />
  <Toolbar />
</BlockControls>

Copy link
Author

Choose a reason for hiding this comment

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

That would make things much cleaner. It should probably be done as a separate pull request though.

Copy link
Author

Choose a reason for hiding this comment

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

Nevermind, I see how it can be done now - I had assumed that the controls prop were the only way to set the content of the element.

@BoardJames BoardJames merged commit 3abb2f9 into master Jun 16, 2017
@BoardJames BoardJames deleted the update/1038-freeform-block-add-more-drawer branch June 16, 2017 01:24
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