OLD | NEW |
| (Empty) |
1 | |
2 Polymer('paper-shadow',{ | |
3 | |
4 publish: { | |
5 | |
6 /** | |
7 * The z-depth of this shadow, from 0-5. Setting this property | |
8 * after element creation has no effect. Use `setZ()` instead. | |
9 * | |
10 * @attribute z | |
11 * @type number | |
12 * @default 1 | |
13 */ | |
14 z: 1, | |
15 | |
16 /** | |
17 * Set this to true to animate the shadow when setting a new | |
18 * `z` value. | |
19 * | |
20 * @attribute animated | |
21 * @type boolean | |
22 * @default false | |
23 */ | |
24 animated: false | |
25 | |
26 }, | |
27 | |
28 /** | |
29 * Set the z-depth of the shadow. This should be used after element | |
30 * creation instead of setting the z property directly. | |
31 * | |
32 * @method setZ | |
33 * @param {Number} newZ | |
34 */ | |
35 setZ: function(newZ) { | |
36 if (this.z !== newZ) { | |
37 this.$['shadow-bottom'].classList.remove('paper-shadow-bottom-z-' + this
.z); | |
38 this.$['shadow-bottom'].classList.add('paper-shadow-bottom-z-' + newZ); | |
39 this.$['shadow-top'].classList.remove('paper-shadow-top-z-' + this.z); | |
40 this.$['shadow-top'].classList.add('paper-shadow-top-z-' + newZ); | |
41 this.z = newZ; | |
42 } | |
43 } | |
44 | |
45 }); | |
OLD | NEW |