| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |