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

feat(menu): increase nested menu elevation based on depth #5937

Merged
merged 2 commits into from
Jul 28, 2017

Conversation

crisbeto
Copy link
Member

Increases the sub-menu elevation, based on its depth. Spec for reference

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 21, 2017
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM, just nits. Apply label when ready.

@@ -62,8 +63,8 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
/** Current state of the panel animation. */
_panelAnimationState: 'void' | 'enter-start' | 'enter' = 'void';

/** Whether the menu is a sub-menu or a top-level menu. */
isSubmenu: boolean = false;
/** Parent menu os the current menu panel. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: os -> of

@@ -181,6 +182,25 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
this._classList['mat-menu-below'] = posY === 'below';
}

/**
* Sets the menu panel elevation.
* @param depth Amount of parent menus that come before the menu.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Amount of parent menus -> Number of parent menus (sounds more natural)

*/
setElevation(depth: number): void {
// The elevation starts at 2 and increases by one for each level.
const newElevation = `mat-elevation-z${depth + 2}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the starting elevation a constant? Like MD_MENU_BASE_ELEVATION

@kara kara assigned crisbeto and unassigned kara Jul 21, 2017
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jul 22, 2017
@andrewseguin
Copy link
Contributor

Please rebase

@crisbeto
Copy link
Member Author

Rebased @andrewseguin.

@andrewseguin andrewseguin merged commit 91f7bf7 into angular:master Jul 28, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants