Skip to content

Commit

Permalink
Move the menu to the same level as mover cells
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed May 19, 2020
1 parent 691c486 commit cfd84f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
19 changes: 15 additions & 4 deletions packages/block-editor/src/components/block-navigation/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export default function BlockNavigationBlock( {
const {
__experimentalWithEllipsisMenu: withEllipsisMenu,
} = useBlockNavigationContext();
const ellipsisMenuClassName = classnames(
'block-editor-block-navigation-block__menu-cell',
{ 'is-visible': hasVisibleMovers }
);

return (
<BlockNavigationLeaf
Expand Down Expand Up @@ -85,10 +89,6 @@ export default function BlockNavigationBlock( {
level={ level }
{ ...props }
/>

{ withEllipsisMenu && level > 1 && (
<BlockSettingsMenu clientIds={ [ clientId ] } />
) }
</div>
) }
</TreeGridCell>
Expand All @@ -114,6 +114,17 @@ export default function BlockNavigationBlock( {
</TreeGridCell>
</>
) }

{ withEllipsisMenu && level > 1 && (
<TreeGridCell className={ ellipsisMenuClassName }>
{ ( props ) => (
<BlockSettingsMenu
clientIds={ [ clientId ] }
{ ...props }
/>
) }
</TreeGridCell>
) }
</BlockNavigationLeaf>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ $tree-item-height: 36px;
border-radius: $border-width;
}

.block-editor-block-navigation-block__menu-cell,
.block-editor-block-navigation-block__mover-cell {
width: $button-size;
opacity: 0;
Expand All @@ -66,6 +67,10 @@ $tree-item-height: 36px;
opacity: 1;
@include edit-post__fade-in-animation;
}

.components-toolbar {
border: 0;
}
}

.block-editor-block-mover-button {
Expand Down Expand Up @@ -106,10 +111,6 @@ $tree-item-height: 36px;
.block-editor-block-navigation-block__contents-container,
.block-editor-block-navigation-appender__container {
display: flex;

.components-toolbar {
border: 0;
}
}

.block-editor-block-navigator-descender-line {
Expand Down

0 comments on commit cfd84f2

Please sign in to comment.