Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-spinner / paper-spinner-extracted.js
blob2cdc5736b9640637faa8782fd03a8846ecce54d4
3 Polymer({
5 is: 'paper-spinner',
7 listeners: {
8 'animationend': 'reset',
9 'webkitAnimationEnd': 'reset'
12 properties: {
14 /**
15 * Displays the spinner.
17 * @attribute active
18 * @type boolean
19 * @default false
21 active: {
22 type: Boolean,
23 value: false,
24 reflectToAttribute: true,
25 observer: '_activeChanged'
28 /**
29 * Alternative text content for accessibility support.
30 * If alt is present, it will add an aria-label whose content matches alt when active.
31 * If alt is not present, it will default to 'loading' as the alt value.
33 * @attribute alt
34 * @type string
35 * @default 'loading'
37 alt: {
38 type: String,
39 value: 'loading',
40 observer: '_altChanged'
43 /**
44 * True when the spinner is going from active to inactive. This is represented by a fade
45 * to 0% opacity to the user.
47 _coolingDown: {
48 type: Boolean,
49 value: false
52 _spinnerContainerClassName: {
53 type: String,
54 computed: '_computeSpinnerContainerClassName(active, _coolingDown)'
59 _computeSpinnerContainerClassName: function(active, coolingDown) {
60 return [
61 active || coolingDown ? 'active' : '',
62 coolingDown ? 'cooldown' : ''
63 ].join(' ');
66 _activeChanged: function(active, old) {
67 this._setAriaHidden(!active);
68 if (!active && old) {
69 this._coolingDown = true;
73 _altChanged: function(alt) {
74 // user-provided `aria-label` takes precedence over prototype default
75 if (alt === this.getPropertyInfo('alt').value) {
76 this.alt = this.getAttribute('aria-label') || alt;
77 } else {
78 this._setAriaHidden(alt==='');
79 this.setAttribute('aria-label', alt);
83 _setAriaHidden: function(hidden) {
84 var attr = 'aria-hidden';
85 if (hidden) {
86 this.setAttribute(attr, 'true');
87 } else {
88 this.removeAttribute(attr);
92 reset: function() {
93 this.active = false;
94 this._coolingDown = false;
97 });