| OLD | NEW |
| (Empty) |
| 1 Polymer({ | |
| 2 is: 'paper-card', | |
| 3 | |
| 4 properties: { | |
| 5 /** | |
| 6 * The title of the card. | |
| 7 */ | |
| 8 heading: { | |
| 9 type: String, | |
| 10 value: '', | |
| 11 observer: '_headingChanged' | |
| 12 }, | |
| 13 | |
| 14 /** | |
| 15 * The url of the title image of the card. | |
| 16 */ | |
| 17 image: { | |
| 18 type: String, | |
| 19 value: '' | |
| 20 }, | |
| 21 | |
| 22 /** | |
| 23 * When `true`, any change to the image url property will cause the | |
| 24 * `placeholder` image to be shown until the image is fully rendered. | |
| 25 */ | |
| 26 preloadImage: { | |
| 27 type: Boolean, | |
| 28 value: false | |
| 29 }, | |
| 30 | |
| 31 /** | |
| 32 * When `preloadImage` is true, setting `fadeImage` to true will cause t
he | |
| 33 * image to fade into place. | |
| 34 */ | |
| 35 fadeImage: { | |
| 36 type: Boolean, | |
| 37 value: false | |
| 38 }, | |
| 39 | |
| 40 /** | |
| 41 * The z-depth of the card, from 0-5. | |
| 42 */ | |
| 43 elevation: { | |
| 44 type: Number, | |
| 45 value: 1, | |
| 46 reflectToAttribute: true | |
| 47 }, | |
| 48 | |
| 49 /** | |
| 50 * Set this to true to animate the card shadow when setting a new | |
| 51 * `z` value. | |
| 52 */ | |
| 53 animatedShadow: { | |
| 54 type: Boolean, | |
| 55 value: false | |
| 56 }, | |
| 57 | |
| 58 /** | |
| 59 * Read-only property used to pass down the `animatedShadow` value to | |
| 60 * the underlying paper-material style (since they have different names)
. | |
| 61 */ | |
| 62 animated: { | |
| 63 type: Boolean, | |
| 64 reflectToAttribute: true, | |
| 65 readOnly: true, | |
| 66 computed: '_computeAnimated(animatedShadow)' | |
| 67 } | |
| 68 }, | |
| 69 | |
| 70 _headingChanged: function(heading) { | |
| 71 var label = this.getAttribute('aria-label'); | |
| 72 this.setAttribute('aria-label', heading); | |
| 73 }, | |
| 74 | |
| 75 _computeHeadingClass: function(image) { | |
| 76 var cls = 'title-text'; | |
| 77 if (image) | |
| 78 cls += ' over-image'; | |
| 79 return cls; | |
| 80 }, | |
| 81 | |
| 82 _computeAnimated: function(animatedShadow) { | |
| 83 return animatedShadow; | |
| 84 } | |
| 85 }); | |
| OLD | NEW |