OLD | NEW |
1 Polymer({ | 1 Polymer({ |
2 is: 'paper-fab', | 2 is: 'paper-fab', |
3 | 3 |
4 behaviors: [ | 4 behaviors: [ |
5 Polymer.PaperButtonBehavior | 5 Polymer.PaperButtonBehavior |
6 ], | 6 ], |
7 | 7 |
8 properties: { | 8 properties: { |
9 /** | 9 /** |
10 * The URL of an image for the icon. If the src property is specified, | 10 * The URL of an image for the icon. If the src property is specified, |
11 * the icon property should not be. | 11 * the icon property should not be. |
12 * | 12 */ |
13 * @attribute src | 13 src: { |
14 * @type string | 14 type: String, |
15 * @default '' | 15 value: '' |
16 */ | 16 }, |
17 src: { | 17 |
18 type: String, | 18 /** |
19 value: '' | 19 * Specifies the icon name or index in the set of icons available in |
| 20 * the icon's icon set. If the icon property is specified, |
| 21 * the src property should not be. |
| 22 */ |
| 23 icon: { |
| 24 type: String, |
| 25 value: '' |
| 26 }, |
| 27 |
| 28 /** |
| 29 * Set this to true to style this is a "mini" FAB. |
| 30 */ |
| 31 mini: { |
| 32 type: Boolean, |
| 33 value: false, |
| 34 reflectToAttribute: true |
| 35 }, |
| 36 |
| 37 /** |
| 38 * The label displayed in the badge. The label is centered, and ideally |
| 39 * should have very few characters. |
| 40 */ |
| 41 label: { |
| 42 type: String, |
| 43 observer: '_labelChanged' |
| 44 } |
20 }, | 45 }, |
21 | 46 |
22 /** | 47 _labelChanged: function() { |
23 * Specifies the icon name or index in the set of icons available in | 48 this.setAttribute('aria-label', this.label); |
24 * the icon's icon set. If the icon property is specified, | |
25 * the src property should not be. | |
26 * | |
27 * @attribute icon | |
28 * @type string | |
29 * @default '' | |
30 */ | |
31 icon: { | |
32 type: String, | |
33 value: '' | |
34 }, | 49 }, |
35 | 50 |
36 /** | 51 _computeIsIconFab: function(icon, src) { |
37 * Set this to true to style this is a "mini" FAB. | 52 return (icon.length > 0) || (src.length > 0); |
38 * | |
39 * @attribute mini | |
40 * @type boolean | |
41 * @default false | |
42 */ | |
43 mini: { | |
44 type: Boolean, | |
45 value: false, | |
46 reflectToAttribute: true | |
47 } | 53 } |
48 } | 54 }); |
49 }); | |
OLD | NEW |