@@ -21,9 +21,9 @@ import {
2121 inputs : [ 'color' ] ,
2222 host : {
2323 '[class.md-button-focus]' : 'isKeyboardFocused' ,
24- '(mousedown)' : 'setMousedown ()' ,
25- '(focus)' : 'setKeyboardFocus ()' ,
26- '(blur)' : 'removeKeyboardFocus ()' ,
24+ '(mousedown)' : '_setMousedown ()' ,
25+ '(focus)' : '_setKeyboardFocus ()' ,
26+ '(blur)' : '_removeKeyboardFocus ()' ,
2727 } ,
2828 templateUrl : 'button.html' ,
2929 styleUrls : [ 'button.css' ] ,
@@ -34,12 +34,12 @@ export class MdButton {
3434 private _color : string ;
3535
3636 /** Whether the button has focus from the keyboard (not the mouse). Used for class binding. */
37- isKeyboardFocused : boolean = false ;
37+ _isKeyboardFocused : boolean = false ;
3838
3939 /** Whether a mousedown has occurred on this element in the last 100ms. */
40- isMouseDown : boolean = false ;
40+ _isMouseDown : boolean = false ;
4141
42- constructor ( private elementRef : ElementRef , private renderer : Renderer ) { }
42+ constructor ( private _elementRef : ElementRef , private _renderer : Renderer ) { }
4343
4444 get color ( ) : string {
4545 return this . _color ;
@@ -49,14 +49,13 @@ export class MdButton {
4949 this . _updateColor ( value ) ;
5050 }
5151
52- /** @internal */
53- setMousedown ( ) {
52+ _setMousedown ( ) {
5453 // We only *show* the focus style when focus has come to the button via the keyboard.
5554 // The Material Design spec is silent on this topic, and without doing this, the
5655 // button continues to look :active after clicking.
5756 // @see http://marcysutton.com/button-focus-hell/
58- this . isMouseDown = true ;
59- setTimeout ( ( ) => { this . isMouseDown = false ; } , 100 ) ;
57+ this . _isMouseDown = true ;
58+ setTimeout ( ( ) => { this . _isMouseDown = false ; } , 100 ) ;
6059 }
6160
6261 _updateColor ( newColor : string ) {
@@ -67,23 +66,21 @@ export class MdButton {
6766
6867 _setElementColor ( color : string , isAdd : boolean ) {
6968 if ( color != null && color != '' ) {
70- this . renderer . setElementClass ( this . elementRef . nativeElement , `md-${ color } ` , isAdd ) ;
69+ this . _renderer . setElementClass ( this . _elementRef . nativeElement , `md-${ color } ` , isAdd ) ;
7170 }
7271 }
7372
74- /** @internal */
75- setKeyboardFocus ( ) {
76- this . isKeyboardFocused = ! this . isMouseDown ;
73+ _setKeyboardFocus ( ) {
74+ this . _isKeyboardFocused = ! this . _isMouseDown ;
7775 }
7876
79- /** @internal */
80- removeKeyboardFocus ( ) {
81- this . isKeyboardFocused = false ;
77+ _removeKeyboardFocus ( ) {
78+ this . _isKeyboardFocused = false ;
8279 }
8380
8481 /** TODO(hansl): e2e test this function. */
8582 focus ( ) {
86- this . elementRef . nativeElement . focus ( ) ;
83+ this . _elementRef . nativeElement . focus ( ) ;
8784 }
8885}
8986
@@ -92,11 +89,11 @@ export class MdButton {
9289 selector : 'a[md-button], a[md-raised-button], a[md-icon-button], a[md-fab], a[md-mini-fab]' ,
9390 inputs : [ 'color' ] ,
9491 host : {
95- '[class.md-button-focus]' : 'isKeyboardFocused ' ,
96- '(mousedown)' : 'setMousedown ()' ,
97- '(focus)' : 'setKeyboardFocus ()' ,
98- '(blur)' : 'removeKeyboardFocus ()' ,
99- '(click)' : 'haltDisabledEvents ($event)' ,
92+ '[class.md-button-focus]' : '_isKeyboardFocused ' ,
93+ '(mousedown)' : '_setMousedown ()' ,
94+ '(focus)' : '_setKeyboardFocus ()' ,
95+ '(blur)' : '_removeKeyboardFocus ()' ,
96+ '(click)' : '_haltDisabledEvents ($event)' ,
10097 } ,
10198 templateUrl : 'button.html' ,
10299 styleUrls : [ 'button.css' ] ,
@@ -129,8 +126,7 @@ export class MdAnchor extends MdButton {
129126 this . _disabled = ( value != null && value != false ) ? true : null ;
130127 }
131128
132- /** @internal */
133- haltDisabledEvents ( event : Event ) {
129+ _haltDisabledEvents ( event : Event ) {
134130 // A disabled button shouldn't apply any actions
135131 if ( this . disabled ) {
136132 event . preventDefault ( ) ;
0 commit comments