@@ -47,6 +47,13 @@ export interface MdMenuDefaultOptions {
47
47
export const MD_MENU_DEFAULT_OPTIONS =
48
48
new InjectionToken < MdMenuDefaultOptions > ( 'md-menu-default-options' ) ;
49
49
50
+ /**
51
+ * Start elevation for the menu panel.
52
+ * @docs -private
53
+ */
54
+ const MD_MENU_BASE_ELEVATION = 2 ;
55
+
56
+
50
57
@Component ( {
51
58
moduleId : module . id ,
52
59
selector : 'md-menu, mat-menu' ,
@@ -75,7 +82,7 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
75
82
/** Current state of the panel animation. */
76
83
_panelAnimationState : 'void' | 'enter-start' | 'enter' = 'void' ;
77
84
78
- /** Parent menu os the current menu panel. */
85
+ /** Parent menu of the current menu panel. */
79
86
parentMenu : MdMenuPanel | undefined ;
80
87
81
88
/** Layout direction of the menu. */
@@ -198,11 +205,11 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
198
205
199
206
/**
200
207
* Sets the menu panel elevation.
201
- * @param depth Amount of parent menus that come before the menu.
208
+ * @param depth Number of parent menus that come before the menu.
202
209
*/
203
210
setElevation ( depth : number ) : void {
204
- // The elevation starts at 2 and increases by one for each level.
205
- const newElevation = `mat-elevation-z${ depth + 2 } ` ;
211
+ // The elevation starts at the base and increases by one for each level.
212
+ const newElevation = `mat-elevation-z${ MD_MENU_BASE_ELEVATION + depth } ` ;
206
213
const customElevation = Object . keys ( this . _classList ) . find ( c => c . startsWith ( 'mat-elevation-z' ) ) ;
207
214
208
215
if ( ! customElevation || customElevation === this . _previousElevation ) {
0 commit comments