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

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

Issue 2956213002: [MD Bookmarks] Make disabled buttons in context menu do nothing when clicked. (Closed)
Patch Set: 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 /** 5 /**
6 * @fileoverview Element which shows context menus and handles keyboard 6 * @fileoverview Element which shows context menus and handles keyboard
7 * shortcuts. 7 * shortcuts.
8 */ 8 */
9 cr.define('bookmarks', function() { 9 cr.define('bookmarks', function() {
10 10
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } else { 452 } else {
453 this.openCommandMenuAtPosition(e.detail.x, e.detail.y); 453 this.openCommandMenuAtPosition(e.detail.x, e.detail.y);
454 } 454 }
455 }, 455 },
456 456
457 /** 457 /**
458 * @param {Event} e 458 * @param {Event} e
459 * @private 459 * @private
460 */ 460 */
461 onCommandClick_: function(e) { 461 onCommandClick_: function(e) {
462 if (e.currentTarget.getAttribute('disabled') != null)
463 return;
464
462 this.handle( 465 this.handle(
463 e.currentTarget.getAttribute('command'), assert(this.menuIds_)); 466 e.currentTarget.getAttribute('command'), assert(this.menuIds_));
464 this.closeCommandMenu(); 467 this.closeCommandMenu();
465 }, 468 },
466 469
467 /** 470 /**
468 * @param {!Event} e 471 * @param {!Event} e
469 * @private 472 * @private
470 */ 473 */
471 onKeydown_: function(e) { 474 onKeydown_: function(e) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 587
585 /** @return {!bookmarks.CommandManager} */ 588 /** @return {!bookmarks.CommandManager} */
586 CommandManager.getInstance = function() { 589 CommandManager.getInstance = function() {
587 return assert(CommandManager.instance_); 590 return assert(CommandManager.instance_);
588 }; 591 };
589 592
590 return { 593 return {
591 CommandManager: CommandManager, 594 CommandManager: CommandManager,
592 }; 595 };
593 }); 596 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698