OLD | NEW |
1 (function() { | 1 (function() { |
2 | 2 |
3 Polymer({ | 3 Polymer({ |
4 | 4 |
5 is: 'paper-dialog', | 5 is: 'paper-dialog', |
6 | 6 |
7 behaviors: [ | 7 behaviors: [ |
8 Polymer.PaperDialogBehavior, | 8 Polymer.PaperDialogBehavior, |
9 Polymer.NeonAnimationRunnerBehavior | 9 Polymer.NeonAnimationRunnerBehavior |
10 ], | 10 ], |
11 | 11 |
12 listeners: { | 12 listeners: { |
13 'neon-animation-finish': '_onNeonAnimationFinish' | 13 'neon-animation-finish': '_onNeonAnimationFinish' |
14 }, | 14 }, |
15 | 15 |
16 _renderOpened: function() { | 16 _renderOpened: function() { |
| 17 this.cancelAnimation(); |
17 if (this.withBackdrop) { | 18 if (this.withBackdrop) { |
18 this.backdropElement.open(); | 19 this.backdropElement.open(); |
19 } | 20 } |
20 this.playAnimation('entry'); | 21 this.playAnimation('entry'); |
21 }, | 22 }, |
22 | 23 |
23 _renderClosed: function() { | 24 _renderClosed: function() { |
| 25 this.cancelAnimation(); |
24 if (this.withBackdrop) { | 26 if (this.withBackdrop) { |
25 this.backdropElement.close(); | 27 this.backdropElement.close(); |
26 } | 28 } |
27 this.playAnimation('exit'); | 29 this.playAnimation('exit'); |
28 }, | 30 }, |
29 | 31 |
30 _onNeonAnimationFinish: function() { | 32 _onNeonAnimationFinish: function() { |
31 if (this.opened) { | 33 if (this.opened) { |
32 this._finishRenderOpened(); | 34 this._finishRenderOpened(); |
33 } else { | 35 } else { |
34 this._finishRenderClosed(); | 36 this._finishRenderClosed(); |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 }); | 40 }); |
39 | 41 |
40 })(); | 42 })(); |
OLD | NEW |