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

Side by Side Diff: ui/webui/resources/js/cr/ui/list.js

Issue 515853002: "ctrl + double click" acts on the highlighted/selected bookmark list items irrespective of on which… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: put the implementation in dblclick event handler in list.js Created 6 years, 3 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
« no previous file with comments | « AUTHORS ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // require: array_data_model.js 5 // require: array_data_model.js
6 // require: list_selection_model.js 6 // require: list_selection_model.js
7 // require: list_selection_controller.js 7 // require: list_selection_controller.js
8 // require: list_item.js 8 // require: list_item.js
9 9
10 /** 10 /**
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 * @param {Event} e The mouse event object. 460 * @param {Event} e The mouse event object.
461 * @private 461 * @private
462 */ 462 */
463 handleDoubleClick_: function(e) { 463 handleDoubleClick_: function(e) {
464 if (this.disabled) 464 if (this.disabled)
465 return; 465 return;
466 466
467 var target = /** @type {HTMLElement} */(e.target); 467 var target = /** @type {HTMLElement} */(e.target);
468 468
469 var ancestor = this.getListItemAncestor(target); 469 var ancestor = this.getListItemAncestor(target);
470 if (ancestor) 470 var index = -1;
471 this.activateItemAtIndex(this.getIndexOfListItem(ancestor)); 471 if (ancestor) {
472 index = this.getIndexOfListItem(ancestor);
473 this.activateItemAtIndex(index);
474 }
475
476 var sm = this.selectionModel;
477 var indexSelected = sm.getIndexSelected(index);
478 if (!indexSelected)
479 this.handlePointerDownUp_(e);
472 }, 480 },
473 481
474 /** 482 /**
475 * Callback for mousedown and mouseup events. 483 * Callback for mousedown and mouseup events.
476 * @param {Event} e The mouse event object. 484 * @param {Event} e The mouse event object.
477 * @private 485 * @private
478 */ 486 */
479 handlePointerDownUp_: function(e) { 487 handlePointerDownUp_: function(e) {
480 if (this.disabled) 488 if (this.disabled)
481 return; 489 return;
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 if (element.tabIndex >= 0 && !element.disabled) 1347 if (element.tabIndex >= 0 && !element.disabled)
1340 return true; 1348 return true;
1341 } 1349 }
1342 return false; 1350 return false;
1343 } 1351 }
1344 1352
1345 return { 1353 return {
1346 List: List 1354 List: List
1347 }; 1355 };
1348 }); 1356 });
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698