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

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

Issue 2962283002: MD Bookmarks: Add 'show in folder' command to search result context menu (Closed)
Patch Set: Add MenuSource to CommandManager. Created 3 years, 5 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-folder-node', 6 is: 'bookmarks-folder-node',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.MouseFocusBehavior, 9 bookmarks.MouseFocusBehavior,
10 bookmarks.StoreClient, 10 bookmarks.StoreClient,
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 }, 276 },
277 277
278 /** 278 /**
279 * @param {!Event} e 279 * @param {!Event} e
280 * @private 280 * @private
281 */ 281 */
282 onContextMenu_: function(e) { 282 onContextMenu_: function(e) {
283 e.preventDefault(); 283 e.preventDefault();
284 this.selectFolder_(); 284 this.selectFolder_();
285 bookmarks.CommandManager.getInstance().openCommandMenuAtPosition( 285 bookmarks.CommandManager.getInstance().openCommandMenuAtPosition(
286 e.clientX, e.clientY, new Set([this.itemId])); 286 e.clientX, e.clientY, MenuSource.TREE, new Set([this.itemId]));
287 }, 287 },
288 288
289 /** 289 /**
290 * @private 290 * @private
291 * @return {!Array<!BookmarksFolderNodeElement>} 291 * @return {!Array<!BookmarksFolderNodeElement>}
292 */ 292 */
293 getChildFolderNodes_: function() { 293 getChildFolderNodes_: function() {
294 return Array.from(this.root.querySelectorAll('bookmarks-folder-node')); 294 return Array.from(this.root.querySelectorAll('bookmarks-folder-node'));
295 }, 295 },
296 296
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 * @param {boolean} isClosed 378 * @param {boolean} isClosed
379 * @private 379 * @private
380 */ 380 */
381 updateAriaExpanded_: function(hasChildFolder, isClosed) { 381 updateAriaExpanded_: function(hasChildFolder, isClosed) {
382 if (hasChildFolder) 382 if (hasChildFolder)
383 this.getFocusTarget().setAttribute('aria-expanded', String(!isClosed)); 383 this.getFocusTarget().setAttribute('aria-expanded', String(!isClosed));
384 else 384 else
385 this.getFocusTarget().removeAttribute('aria-expanded'); 385 this.getFocusTarget().removeAttribute('aria-expanded');
386 }, 386 },
387 }); 387 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/constants.js ('k') | chrome/browser/resources/md_bookmarks/item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698