| 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 /** Same as paper-menu-button's custom easing cubic-bezier param. */ | 5 /** Same as paper-menu-button's custom easing cubic-bezier param. */ |
| 6 var SLIDE_CUBIC_BEZIER = 'cubic-bezier(0.3, 0.95, 0.5, 1)'; | 6 var SLIDE_CUBIC_BEZIER = 'cubic-bezier(0.3, 0.95, 0.5, 1)'; |
| 7 | 7 |
| 8 Polymer({ | 8 Polymer({ |
| 9 is: 'cr-shared-menu', | 9 is: 'cr-shared-menu', |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 }, | 63 }, |
| 64 | 64 |
| 65 closeAnimationConfig: { | 65 closeAnimationConfig: { |
| 66 type: Object, | 66 type: Object, |
| 67 value: function() { | 67 value: function() { |
| 68 return [{ | 68 return [{ |
| 69 name: 'fade-out-animation', | 69 name: 'fade-out-animation', |
| 70 timing: { | 70 timing: { |
| 71 duration: 150 | 71 duration: 150 |
| 72 } | 72 } |
| 73 }, { | |
| 74 name: 'paper-menu-shrink-width-animation', | |
| 75 timing: { | |
| 76 delay: 100, | |
| 77 duration: 50, | |
| 78 easing: SLIDE_CUBIC_BEZIER | |
| 79 } | |
| 80 }, { | |
| 81 name: 'paper-menu-shrink-height-animation', | |
| 82 timing: { | |
| 83 delay: 200, | |
| 84 easing: 'ease-in' | |
| 85 } | |
| 86 }]; | 73 }]; |
| 87 } | 74 } |
| 88 } | 75 } |
| 89 }, | 76 }, |
| 90 | 77 |
| 91 keyBindings: { | 78 keyBindings: { |
| 92 'tab': 'onTabPressed_', | 79 'tab': 'onTabPressed_', |
| 93 }, | 80 }, |
| 94 | 81 |
| 95 listeners: { | 82 listeners: { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 * Prevent focus restoring when tapping outside the menu. This stops the | 198 * Prevent focus restoring when tapping outside the menu. This stops the |
| 212 * focus moving around unexpectedly when closing the menu with the mouse. | 199 * focus moving around unexpectedly when closing the menu with the mouse. |
| 213 * @param {CustomEvent} e | 200 * @param {CustomEvent} e |
| 214 * @private | 201 * @private |
| 215 */ | 202 */ |
| 216 onOverlayCanceled_: function(e) { | 203 onOverlayCanceled_: function(e) { |
| 217 if (e.detail.type == 'tap') | 204 if (e.detail.type == 'tap') |
| 218 this.$.dropdown.restoreFocusOnClose = false; | 205 this.$.dropdown.restoreFocusOnClose = false; |
| 219 }, | 206 }, |
| 220 }); | 207 }); |
| OLD | NEW |