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

Side by Side Diff: chrome/browser/resources/md_bookmarks/toolbar.js

Issue 2940233003: MD Bookmarks: Lazily render dropdown menus (Closed)
Patch Set: Flush before show Created 3 years, 6 months 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
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: 'bookmarks-toolbar', 6 is: 'bookmarks-toolbar',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 get searchField() { 71 get searchField() {
72 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar')) 72 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar'))
73 .getSearchField(); 73 .getSearchField();
74 }, 74 },
75 75
76 /** 76 /**
77 * @param {Event} e 77 * @param {Event} e
78 * @private 78 * @private
79 */ 79 */
80 onMenuButtonOpenTap_: function(e) { 80 onMenuButtonOpenTap_: function(e) {
81 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); 81 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown.get());
calamity 2017/06/21 08:38:27 Why does this not require an immediate flush?
tsergeant 2017/06/22 00:10:12 The flush() is only needed to work with the dom-re
82 menu.showAt(/** @type {!Element} */ (e.target)); 82 menu.showAt(/** @type {!Element} */ (e.target));
83 }, 83 },
84 84
85 /** @private */ 85 /** @private */
86 onSortTap_: function() { 86 onSortTap_: function() {
87 chrome.bookmarkManagerPrivate.sortChildren( 87 chrome.bookmarkManagerPrivate.sortChildren(
88 assert(this.getState().selectedFolder)); 88 assert(this.getState().selectedFolder));
89 bookmarks.ToastManager.getInstance().show( 89 bookmarks.ToastManager.getInstance().show(
90 loadTimeData.getString('toastFolderSorted'), true); 90 loadTimeData.getString('toastFolderSorted'), true);
91 this.closeDropdownMenu_(); 91 this.closeDropdownMenu_();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 commandManager.handle(Command.DELETE, selection); 127 commandManager.handle(Command.DELETE, selection);
128 }, 128 },
129 129
130 /** @private */ 130 /** @private */
131 onClearSelectionTap_: function() { 131 onClearSelectionTap_: function() {
132 this.dispatch(bookmarks.actions.deselectItems()); 132 this.dispatch(bookmarks.actions.deselectItems());
133 }, 133 },
134 134
135 /** @private */ 135 /** @private */
136 closeDropdownMenu_: function() { 136 closeDropdownMenu_: function() {
137 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); 137 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown.get());
138 menu.close(); 138 menu.close();
139 }, 139 },
140 140
141 /** 141 /**
142 * @param {Event} e 142 * @param {Event} e
143 * @private 143 * @private
144 */ 144 */
145 onSearchChanged_: function(e) { 145 onSearchChanged_: function(e) {
146 var searchTerm = /** @type {string} */ (e.detail); 146 var searchTerm = /** @type {string} */ (e.detail);
147 if (searchTerm != this.searchTerm_) 147 if (searchTerm != this.searchTerm_)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 }, 182 },
183 183
184 /** 184 /**
185 * @return {string} 185 * @return {string}
186 * @private 186 * @private
187 */ 187 */
188 getItemsSelectedString_: function() { 188 getItemsSelectedString_: function() {
189 return loadTimeData.getStringF('itemsSelected', this.selectedItems_.size); 189 return loadTimeData.getStringF('itemsSelected', this.selectedItems_.size);
190 }, 190 },
191 }); 191 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/toolbar.html ('k') | chrome/test/data/webui/md_bookmarks/command_manager_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698