Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.js

Issue 2450663003: MD History: hide tooltip promo when drawer is swiped open (Closed)
Patch Set: on-lonely="fixUpCode_" Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)', 57 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)',
58 ], 58 ],
59 59
60 /** @return {!CrToolbarSearchFieldElement} */ 60 /** @return {!CrToolbarSearchFieldElement} */
61 getSearchField: function() { 61 getSearchField: function() {
62 return this.$.search; 62 return this.$.search;
63 }, 63 },
64 64
65 /** @private */ 65 /** @private */
66 onClosePromoTap_: function() { 66 onClosePromoTap_: function() {
67 this.showMenuPromo = false; 67 this.fire('cr-toolbar-menu-promo-close');
68 }, 68 },
69 69
70 /** @private */ 70 /** @private */
71 onMenuTap_: function() { 71 onMenuTap_: function() {
72 this.fire('cr-menu-tap'); 72 this.fire('cr-toolbar-menu-tap');
73 this.onClosePromoTap_();
74 }, 73 },
75 74
76 /** @private */ 75 /** @private */
77 possiblyShowMenuPromo_: function() { 76 possiblyShowMenuPromo_: function() {
78 Polymer.RenderStatus.afterNextRender(this, function() { 77 Polymer.RenderStatus.afterNextRender(this, function() {
79 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) { 78 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) {
80 this.$$('#menuPromo').animate({ 79 this.$$('#menuPromo').animate({
81 opacity: [0, .9], 80 opacity: [0, .9],
82 }, /** @type {!KeyframeEffectOptions} */({ 81 }, /** @type {!KeyframeEffectOptions} */({
83 duration: 500, 82 duration: 500,
84 fill: 'forwards' 83 fill: 'forwards'
85 })); 84 }));
86 this.fire('cr-menu-promo-shown'); 85 this.fire('cr-toolbar-menu-promo-shown');
87 } 86 }
88 }.bind(this)); 87 }.bind(this));
89 }, 88 },
90 89
91 /** 90 /**
92 * @param {string} title 91 * @param {string} title
93 * @param {boolean} showMenuPromo 92 * @param {boolean} showMenuPromo
94 * @return {string} The title if the menu promo isn't showing, else "". 93 * @return {string} The title if the menu promo isn't showing, else "".
95 */ 94 */
96 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { 95 titleIfNotShowMenuPromo_: function(title, showMenuPromo) {
97 return showMenuPromo ? '' : title; 96 return showMenuPromo ? '' : title;
98 }, 97 },
99 }); 98 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698