OLD | NEW |
1 | 1 |
2 | 2 |
3 Polymer.PaperButtonElevation = { | 3 /** @polymerBehavior */ |
| 4 Polymer.PaperButtonBehaviorImpl = { |
4 | 5 |
5 properties: { | 6 properties: { |
6 | 7 |
7 _elevation: { | 8 _elevation: { |
8 type: Number | 9 type: Number |
9 } | 10 } |
10 | 11 |
11 }, | 12 }, |
12 | 13 |
| 14 observers: [ |
| 15 '_calculateElevation(focused, disabled, active, pressed, receivedFocusFrom
Keyboard)' |
| 16 ], |
| 17 |
| 18 hostAttributes: { |
| 19 role: 'button', |
| 20 tabindex: '0' |
| 21 }, |
| 22 |
13 _calculateElevation: function() { | 23 _calculateElevation: function() { |
14 var e = 1; | 24 var e = 1; |
15 if (this.disabled || !this.raised) { | 25 if (this.disabled) { |
16 e = 0; | 26 e = 0; |
17 } else if (this.active || this.pressed) { | 27 } else if (this.active || this.pressed) { |
18 e = 2; | 28 e = 4; |
19 } else if (this.focused) { | 29 } else if (this.receivedFocusFromKeyboard) { |
20 e = 3; | 30 e = 3; |
21 } | 31 } |
22 this._elevation = e; | 32 this._elevation = e; |
23 } | 33 } |
24 | |
25 }; | 34 }; |
26 | 35 |
27 Polymer.PaperButtonBehavior = [ | 36 Polymer.PaperButtonBehavior = [ |
| 37 Polymer.IronButtonState, |
28 Polymer.IronControlState, | 38 Polymer.IronControlState, |
29 Polymer.IronButtonState, | 39 Polymer.PaperButtonBehaviorImpl |
30 Polymer.PaperButtonElevation | |
31 ]; | 40 ]; |
32 | 41 |
OLD | NEW |