@@ -35,6 +35,13 @@ import {Observable} from 'rxjs/Observable';
35
35
import { Direction } from '../core' ;
36
36
37
37
38
+ /**
39
+ * Start elevation for the menu panel.
40
+ * @docs -private
41
+ */
42
+ const MD_MENU_BASE_ELEVATION = 2 ;
43
+
44
+
38
45
@Component ( {
39
46
moduleId : module . id ,
40
47
selector : 'md-menu, mat-menu' ,
@@ -63,7 +70,7 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
63
70
/** Current state of the panel animation. */
64
71
_panelAnimationState : 'void' | 'enter-start' | 'enter' = 'void' ;
65
72
66
- /** Parent menu os the current menu panel. */
73
+ /** Parent menu of the current menu panel. */
67
74
parentMenu : MdMenuPanel | undefined ;
68
75
69
76
/** Layout direction of the menu. */
@@ -184,11 +191,11 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy {
184
191
185
192
/**
186
193
* Sets the menu panel elevation.
187
- * @param depth Amount of parent menus that come before the menu.
194
+ * @param depth Number of parent menus that come before the menu.
188
195
*/
189
196
setElevation ( depth : number ) : void {
190
- // The elevation starts at 2 and increases by one for each level.
191
- const newElevation = `mat-elevation-z${ depth + 2 } ` ;
197
+ // The elevation starts at the base and increases by one for each level.
198
+ const newElevation = `mat-elevation-z${ MD_MENU_BASE_ELEVATION + depth } ` ;
192
199
const customElevation = Object . keys ( this . _classList ) . find ( c => c . startsWith ( 'mat-elevation-z' ) ) ;
193
200
194
201
if ( ! customElevation || customElevation === this . _previousElevation ) {
0 commit comments