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 Polymer({ | 5 Polymer({ |
6 is: 'cr-toolbar', | 6 is: 'cr-toolbar', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // Name to display in the toolbar, in titlecase. | 9 // Name to display in the toolbar, in titlecase. |
10 pageName: String, | 10 pageName: String, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 /** @private */ | 74 /** @private */ |
75 possiblyShowMenuPromo_: function() { | 75 possiblyShowMenuPromo_: function() { |
76 Polymer.RenderStatus.afterNextRender(this, function() { | 76 Polymer.RenderStatus.afterNextRender(this, function() { |
77 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) { | 77 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) { |
78 this.$$('#menuPromo') | 78 this.$$('#menuPromo') |
79 .animate( | 79 .animate( |
80 { | 80 { |
81 opacity: [0, .9], | 81 opacity: [0, .9], |
82 }, | 82 }, |
83 /** @type {!KeyframeEffectOptions} */ ( | 83 /** @type {!KeyframeEffectOptions} */ ({ |
84 {duration: 500, fill: 'forwards'})); | 84 duration: 500, |
| 85 fill: 'forwards' |
| 86 })); |
85 this.fire('cr-toolbar-menu-promo-shown'); | 87 this.fire('cr-toolbar-menu-promo-shown'); |
86 } | 88 } |
87 }.bind(this)); | 89 }.bind(this)); |
88 }, | 90 }, |
89 | 91 |
90 /** | 92 /** |
91 * @param {string} title | 93 * @param {string} title |
92 * @param {boolean} showMenuPromo | 94 * @param {boolean} showMenuPromo |
93 * @return {string} The title if the menu promo isn't showing, else "". | 95 * @return {string} The title if the menu promo isn't showing, else "". |
94 */ | 96 */ |
95 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { | 97 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { |
96 return showMenuPromo ? '' : title; | 98 return showMenuPromo ? '' : title; |
97 }, | 99 }, |
98 }); | 100 }); |
OLD | NEW |