| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.exportPath('extensions'); | 5 cr.exportPath('extensions'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The different types of animations this helper supports. | 8 * The different types of animations this helper supports. |
| 9 * @enum {number} | 9 * @enum {number} |
| 10 */ | 10 */ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Set the exit animation for the element. | 59 * Set the exit animation for the element. |
| 60 * @param {extensions.Animation} animation | 60 * @param {extensions.Animation} animation |
| 61 */ | 61 */ |
| 62 setExitAnimation: function(animation) { | 62 setExitAnimation: function(animation) { |
| 63 var config; | 63 var config; |
| 64 switch (animation) { | 64 switch (animation) { |
| 65 case extensions.Animation.HERO: | 65 case extensions.Animation.HERO: |
| 66 config = | 66 config = { |
| 67 {name: 'hero-animation', id: 'hero', fromPage: this.element_}; | 67 name: 'hero-animation', |
| 68 id: 'hero', |
| 69 fromPage: this.element_ |
| 70 }; |
| 68 break; | 71 break; |
| 69 case extensions.Animation.FADE_OUT: | 72 case extensions.Animation.FADE_OUT: |
| 70 assert(this.node_); | 73 assert(this.node_); |
| 71 config = {name: 'fade-out-animation', node: this.node_}; | 74 config = {name: 'fade-out-animation', node: this.node_}; |
| 72 break; | 75 break; |
| 73 case extensions.Animation.SCALE_DOWN: | 76 case extensions.Animation.SCALE_DOWN: |
| 74 assert(this.node_); | 77 assert(this.node_); |
| 75 config = { | 78 config = { |
| 76 name: 'scale-down-animation', | 79 name: 'scale-down-animation', |
| 77 node: this.node_, | 80 node: this.node_, |
| 78 transformOrigin: '50% 50%', | 81 transformOrigin: '50% 50%', |
| 79 axis: 'y', | 82 axis: 'y', |
| 80 }; | 83 }; |
| 81 break; | 84 break; |
| 82 default: | 85 default: |
| 83 assertNotReached(); | 86 assertNotReached(); |
| 84 } | 87 } |
| 85 this.element_.animationConfig.exit = [config]; | 88 this.element_.animationConfig.exit = [config]; |
| 86 }, | 89 }, |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 return {AnimationHelper: AnimationHelper}; | 92 return {AnimationHelper: AnimationHelper}; |
| 90 }); | 93 }); |
| OLD | NEW |