Update Polymer and pull in iron-list
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-behaviors / paper-button-behavior-extracted.js
blobb830c52b3da2da76f262ceb18dbd9afc2d1df9a0
3   /** @polymerBehavior */
4   Polymer.PaperButtonBehaviorImpl = {
6     properties: {
8       _elevation: {
9         type: Number
10       }
12     },
14     observers: [
15       '_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)'
16     ],
18     hostAttributes: {
19       role: 'button',
20       tabindex: '0'
21     },
23     _calculateElevation: function() {
24       var e = 1;
25       if (this.disabled) {
26         e = 0;
27       } else if (this.active || this.pressed) {
28         e = 4;
29       } else if (this.receivedFocusFromKeyboard) {
30         e = 3;
31       }
32       this._elevation = e;
33     }
34   };
36   /** @polymerBehavior */
37   Polymer.PaperButtonBehavior = [
38     Polymer.IronButtonState,
39     Polymer.IronControlState,
40     Polymer.PaperButtonBehaviorImpl
41   ];