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

Add basic undo/redo controls in the toolbar #100

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

thibaudcolas
Copy link
Collaborator

Fixes #79.

@thibaudcolas thibaudcolas added the enhancement New feature or request label Oct 17, 2017
@thibaudcolas thibaudcolas added this to the v1.0.0 milestone Oct 17, 2017
@thibaudcolas thibaudcolas merged commit e7f3610 into master Oct 17, 2017
@thibaudcolas thibaudcolas deleted the feature/undo-redo-buttons branch October 17, 2017 12:36
@@ -101,20 +103,42 @@ const Toolbar = ({
/>
))}
</ToolbarGroup>

<ToolbarGroup>

Choose a reason for hiding this comment

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

@thibaudcolas Shouldn't the whole ToolbarGroup be wrapped into the showUndoRedoControls check? Does it displays fine if the group is empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the ToolbarGroup contains some magic so it doesn't render anything when it has no children:

const ToolbarGroup = ({ children }) => {
const hasChildren = React.Children.toArray(children).some(c => c !== null);
return hasChildren ? <div className="toolbar-group">{children}</div> : null;
};

@thibaudcolas thibaudcolas modified the milestones: v1.0.0, Wagtail 2.0 Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants