OLD | NEW |
1 /** @polymerBehavior Polymer.PaperButtonBehavior */ | 1 /** @polymerBehavior Polymer.PaperButtonBehavior */ |
2 Polymer.PaperButtonBehaviorImpl = { | 2 Polymer.PaperButtonBehaviorImpl = { |
3 | 3 |
4 properties: { | 4 properties: { |
5 | 5 |
6 /** | 6 /** |
7 * The z-depth of this element, from 0-5. Setting to 0 will remove the | 7 * The z-depth of this element, from 0-5. Setting to 0 will remove the |
8 * shadow, and each increasing number greater than 0 will be "deeper" | 8 * shadow, and each increasing number greater than 0 will be "deeper" |
9 * than the last. | 9 * than the last. |
10 * | 10 * |
(...skipping 30 matching lines...) Expand all Loading... |
41 e = 3; | 41 e = 3; |
42 } | 42 } |
43 this._setElevation(e); | 43 this._setElevation(e); |
44 }, | 44 }, |
45 | 45 |
46 _computeKeyboardClass: function(receivedFocusFromKeyboard) { | 46 _computeKeyboardClass: function(receivedFocusFromKeyboard) { |
47 this.classList.toggle('keyboard-focus', receivedFocusFromKeyboard); | 47 this.classList.toggle('keyboard-focus', receivedFocusFromKeyboard); |
48 }, | 48 }, |
49 | 49 |
50 /** | 50 /** |
51 * In addition to `IronButtonState` behavior, when space key goes down, | 51 * In addition to `IronButtonState` behavior, when space key goes down, |
52 * create a ripple down effect. | 52 * create a ripple down effect. |
| 53 * |
| 54 * @param {!KeyboardEvent} event . |
53 */ | 55 */ |
54 _spaceKeyDownHandler: function(event) { | 56 _spaceKeyDownHandler: function(event) { |
55 Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this, event); | 57 Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this, event); |
56 if (this.hasRipple()) { | 58 if (this.hasRipple()) { |
57 this._ripple.uiDownAction(); | 59 this._ripple.uiDownAction(); |
58 } | 60 } |
59 }, | 61 }, |
60 | 62 |
61 /** | 63 /** |
62 * In addition to `IronButtonState` behavior, when space key goes up, | 64 * In addition to `IronButtonState` behavior, when space key goes up, |
63 * create a ripple up effect. | 65 * create a ripple up effect. |
| 66 * |
| 67 * @param {!KeyboardEvent} event . |
64 */ | 68 */ |
65 _spaceKeyUpHandler: function(event) { | 69 _spaceKeyUpHandler: function(event) { |
66 Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this, event); | 70 Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this, event); |
67 if (this.hasRipple()) { | 71 if (this.hasRipple()) { |
68 this._ripple.uiUpAction(); | 72 this._ripple.uiUpAction(); |
69 } | 73 } |
70 } | 74 } |
71 | 75 |
72 }; | 76 }; |
73 | 77 |
74 /** @polymerBehavior */ | 78 /** @polymerBehavior */ |
75 Polymer.PaperButtonBehavior = [ | 79 Polymer.PaperButtonBehavior = [ |
76 Polymer.IronButtonState, | 80 Polymer.IronButtonState, |
77 Polymer.IronControlState, | 81 Polymer.IronControlState, |
78 Polymer.PaperRippleBehavior, | 82 Polymer.PaperRippleBehavior, |
79 Polymer.PaperButtonBehaviorImpl | 83 Polymer.PaperButtonBehaviorImpl |
80 ]; | 84 ]; |
OLD | NEW |