OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 <link rel="import" href="../../../polymer/polymer.html"> | 10 <link rel="import" href="../../../polymer/polymer.html"> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 }; | 75 }; |
76 } | 76 } |
77 } | 77 } |
78 }, | 78 }, |
79 | 79 |
80 listeners: { | 80 listeners: { |
81 'click': '_onClick' | 81 'click': '_onClick' |
82 }, | 82 }, |
83 | 83 |
84 _onClick: function(event) { | 84 _onClick: function(event) { |
85 var target = event.target; | 85 var target = Polymer.dom(event).rootTarget; |
86 if (target.classList.contains('circle')) { | 86 if (target.classList.contains('circle')) { |
87 // configure the page animation | 87 // configure the page animation |
88 this.sharedElements = { | 88 this.sharedElements = { |
89 'hero': target | 89 'hero': target |
90 }; | 90 }; |
91 | 91 |
92 var nodesToScale = []; | 92 var nodesToScale = []; |
93 var circles = Polymer.dom(this.root).querySelectorAll('.circle'); | 93 var circles = Polymer.dom(this.root).querySelectorAll('.circle'); |
94 for (var node, index = 0; node = circles[index]; index++) { | 94 for (var node, index = 0; node = circles[index]; index++) { |
95 if (node !== event.target) { | 95 if (node !== event.target) { |
96 nodesToScale.push(node); | 96 nodesToScale.push(node); |
97 } | 97 } |
98 } | 98 } |
99 this.animationConfig['exit'][1].nodes = nodesToScale; | 99 this.animationConfig['exit'][1].nodes = nodesToScale; |
100 | 100 |
101 this.fire('circle-click'); | 101 this.fire('circle-click'); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 }); | 105 }); |
106 | 106 |
107 </script> | 107 </script> |
OLD | NEW |