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

Side by Side Diff: chrome/browser/resources/task_manager/main.js

Issue 8422008: TaskManager: minor UI cleanup (consume Esc with context menu opened, use classList). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/context_menu_handler.js ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** @constructor */ 5 /** @constructor */
6 function TaskManager() { } 6 function TaskManager() { }
7 7
8 cr.addSingletonGetter(TaskManager); 8 cr.addSingletonGetter(TaskManager);
9 9
10 /* 10 /*
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 */ 425 */
426 onTableContextMenuOpened_: function (e) { 426 onTableContextMenuOpened_: function (e) {
427 var command = this.table_menu_commands_['tableContextMenu-inspect']; 427 var command = this.table_menu_commands_['tableContextMenu-inspect'];
428 var menuItem = command.menuitem; 428 var menuItem = command.menuitem;
429 429
430 // Disabled by default. 430 // Disabled by default.
431 menuItem.disabled = true; 431 menuItem.disabled = true;
432 this.currentContextMenuTarget_ = undefined; 432 this.currentContextMenuTarget_ = undefined;
433 433
434 var target = e.target; 434 var target = e.target;
435 var classes = target.className.split(" "); 435 var classes = target.classList;
436 while (target && classes.indexOf('detail-title') == -1) { 436 while (target &&
437 Array.prototype.indexOf.call(classes, 'detail-title') == -1) {
437 target = target.parentNode; 438 target = target.parentNode;
438 classes = target.className.split(" "); 439 classes = target.classList;
439 } 440 }
440 441
441 if (!target) 442 if (!target)
442 return; 443 return;
443 444
444 var index_in_group = target.index_in_group; 445 var index_in_group = target.index_in_group;
445 446
446 var canInspect = target.data['canInspect'][index_in_group]; 447 var canInspect = target.data['canInspect'][index_in_group];
447 if (canInspect) { 448 if (canInspect) {
448 menuItem.disabled = false; 449 menuItem.disabled = false;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 taskmanager.onTaskChange(start, length, tasks); 518 taskmanager.onTaskChange(start, length, tasks);
518 } 519 }
519 520
520 function taskRemoved(start, length) { 521 function taskRemoved(start, length) {
521 // Sometimes this can get called too early. 522 // Sometimes this can get called too early.
522 if (!taskmanager) 523 if (!taskmanager)
523 return; 524 return;
524 taskmanager.onTaskRemove(start, length); 525 taskmanager.onTaskRemove(start, length);
525 } 526 }
526 527
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/context_menu_handler.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698