Skip to content

Commit

Permalink
navigation-link: add chevron to all menu levels
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Jan 21, 2020
1 parent ebf897e commit aeeec37
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,16 @@ function NavigationLinkEdit( {
export default compose( [
withSelect( ( select, ownProps ) => {
const {
getBlockName,
getBlockAttributes,
getBlockParents,
getClientIdsOfDescendants,
hasSelectedInnerBlock,
} = select( 'core/block-editor' );
const { clientId } = ownProps;
const rootBlock = getBlockParents( clientId )[ 0 ];
const parentBlock = getBlockParents( clientId, true )[ 0 ];
const navigationBlockAttributes = getBlockAttributes( rootBlock );
const hasDescendants = !! getClientIdsOfDescendants( [ clientId ] ).length;
const isLevelZero = getBlockName( parentBlock ) === 'core/navigation';
const showSubmenuIcon = navigationBlockAttributes.showSubmenuIcon && isLevelZero && hasDescendants;
const showSubmenuIcon = navigationBlockAttributes.showSubmenuIcon && hasDescendants;
const isParentOfSelectedBlock = hasSelectedInnerBlock( clientId, true );

return {
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/navigation-link/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
white-space: nowrap !important; // TODO: solve differently to prevent use of !important
}


.wp-block-navigation-link__submenu-icon {
margin-left: 4px;
}
Expand Down

0 comments on commit aeeec37

Please sign in to comment.