| 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 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 var fromRect = shared.from.getBoundingClientRect(); | 52 var fromRect = shared.from.getBoundingClientRect(); |
| 53 var toRect = shared.to.getBoundingClientRect(); | 53 var toRect = shared.to.getBoundingClientRect(); |
| 54 | 54 |
| 55 var deltaLeft = fromRect.left - toRect.left; | 55 var deltaLeft = fromRect.left - toRect.left; |
| 56 var deltaTop = fromRect.top - toRect.top; | 56 var deltaTop = fromRect.top - toRect.top; |
| 57 var deltaWidth = fromRect.width / toRect.width; | 57 var deltaWidth = fromRect.width / toRect.width; |
| 58 var deltaHeight = fromRect.height / toRect.height; | 58 var deltaHeight = fromRect.height / toRect.height; |
| 59 | 59 |
| 60 this.setPrefixedProperty(shared.to, 'transformOrigin', '0 0'); | |
| 61 shared.to.style.zIndex = 10000; | |
| 62 shared.from.style.visibility = 'hidden'; | |
| 63 | |
| 64 this._effect = new KeyframeEffect(shared.to, [ | 60 this._effect = new KeyframeEffect(shared.to, [ |
| 65 {'transform': 'translate(' + deltaLeft + 'px,' + deltaTop + 'px) scale('
+ deltaWidth + ',' + deltaHeight + ')'}, | 61 {'transform': 'translate(' + deltaLeft + 'px,' + deltaTop + 'px) scale('
+ deltaWidth + ',' + deltaHeight + ')'}, |
| 66 {'transform': 'none'} | 62 {'transform': 'none'} |
| 67 ], this.timingFromConfig(config)); | 63 ], this.timingFromConfig(config)); |
| 68 | 64 |
| 65 this.setPrefixedProperty(shared.to, 'transformOrigin', '0 0'); |
| 66 shared.to.style.zIndex = 10000; |
| 67 shared.from.style.visibility = 'hidden'; |
| 68 |
| 69 return this._effect; | 69 return this._effect; |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 complete: function(config) { | 72 complete: function(config) { |
| 73 var shared = this.findSharedElements(config); | 73 var shared = this.findSharedElements(config); |
| 74 if (!shared) { | 74 if (!shared) { |
| 75 return null; | 75 return null; |
| 76 } | 76 } |
| 77 shared.to.style.zIndex = ''; | 77 shared.to.style.zIndex = ''; |
| 78 shared.from.style.visibility = ''; | 78 shared.from.style.visibility = ''; |
| 79 } | 79 } |
| 80 | 80 |
| 81 }); | 81 }); |
| 82 | 82 |
| 83 </script> | 83 </script> |
| OLD | NEW |