| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 6 Code distributed by Google as part of the polymer project is also |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 8 --> |
| 9 <link rel="import" href="../../../polymer/polymer.html"> |
| 10 <link rel="import" href="../../neon-animation-runner-behavior.html"> |
| 11 <link rel="import" href="../../animations/scale-down-animation.html"> |
| 12 |
| 13 <dom-module id="my-animatable"> |
| 14 |
| 15 <style> |
| 16 |
| 17 :host { |
| 18 display: inline-block; |
| 19 border-radius: 50%; |
| 20 width: 300px; |
| 21 height: 300px; |
| 22 background: orange; |
| 23 } |
| 24 |
| 25 </style> |
| 26 |
| 27 <template> |
| 28 |
| 29 <content></content> |
| 30 |
| 31 </template> |
| 32 |
| 33 </dom-module> |
| 34 |
| 35 <script> |
| 36 |
| 37 Polymer({ |
| 38 |
| 39 is: 'my-animatable', |
| 40 |
| 41 behaviors: [ |
| 42 Polymer.NeonAnimationRunnerBehavior |
| 43 ], |
| 44 |
| 45 properties: { |
| 46 |
| 47 animationConfig: { |
| 48 type: Object, |
| 49 value: function() { |
| 50 return { |
| 51 name: 'scale-down-animation', |
| 52 node: this |
| 53 } |
| 54 } |
| 55 } |
| 56 |
| 57 }, |
| 58 |
| 59 listeners: { |
| 60 'neon-animation-finish': '_onNeonAnimationFinish' |
| 61 }, |
| 62 |
| 63 animate: function() { |
| 64 this.playAnimation(); |
| 65 }, |
| 66 |
| 67 _onNeonAnimationFinish: function() { |
| 68 console.log('animation finish!'); |
| 69 } |
| 70 |
| 71 }); |
| 72 |
| 73 </script> |
| OLD | NEW |