Chromium Code Reviews| 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var DeletableItem = options.DeletableItem; | 6 /** @const */ var DeletableItem = options.DeletableItem; |
| 7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Creates a new list item with support for inline editing. | 10 * Creates a new list item with support for inline editing. |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 * @type {boolean} | 421 * @type {boolean} |
| 422 */ | 422 */ |
| 423 focusPlaceholder: false, | 423 focusPlaceholder: false, |
| 424 | 424 |
| 425 /** @override */ | 425 /** @override */ |
| 426 decorate: function() { | 426 decorate: function() { |
| 427 DeletableItemList.prototype.decorate.call(this); | 427 DeletableItemList.prototype.decorate.call(this); |
| 428 this.setAttribute('inlineeditable', ''); | 428 this.setAttribute('inlineeditable', ''); |
| 429 this.addEventListener('hasElementFocusChange', | 429 this.addEventListener('hasElementFocusChange', |
| 430 this.handleListFocusChange_); | 430 this.handleListFocusChange_); |
| 431 this.removeAttribute('tabindex'); | 431 this.tabIndex = -1; |
|
Dan Beam
2014/10/27 18:35:00
nit: // <list> isn't focusable by default, but cr.
bondd
2014/10/27 18:46:53
Done.
| |
| 432 }, | 432 }, |
| 433 | 433 |
| 434 /** | 434 /** |
| 435 * Called when the list hierarchy as a whole loses or gains focus; starts | 435 * Called when the list hierarchy as a whole loses or gains focus; starts |
| 436 * or ends editing for the lead item if necessary. | 436 * or ends editing for the lead item if necessary. |
| 437 * @param {Event} e The change event. | 437 * @param {Event} e The change event. |
| 438 * @private | 438 * @private |
| 439 */ | 439 */ |
| 440 handleListFocusChange_: function(e) { | 440 handleListFocusChange_: function(e) { |
| 441 var leadItem = this.getListItemByIndex(this.selectionModel.leadIndex); | 441 var leadItem = this.getListItemByIndex(this.selectionModel.leadIndex); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 456 return true; | 456 return true; |
| 457 }, | 457 }, |
| 458 }; | 458 }; |
| 459 | 459 |
| 460 // Export | 460 // Export |
| 461 return { | 461 return { |
| 462 InlineEditableItem: InlineEditableItem, | 462 InlineEditableItem: InlineEditableItem, |
| 463 InlineEditableItemList: InlineEditableItemList, | 463 InlineEditableItemList: InlineEditableItemList, |
| 464 }; | 464 }; |
| 465 }); | 465 }); |
| OLD | NEW |