| 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 List = cr.ui.List; | 6 /** @const */ var List = cr.ui.List; |
| 7 /** @const */ var ListItem = cr.ui.ListItem; | 7 /** @const */ var ListItem = cr.ui.ListItem; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Creates a deletable list item, which has a button that will trigger a call | 10 * Creates a deletable list item, which has a button that will trigger a call |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 decorate: function() { | 40 decorate: function() { |
| 41 ListItem.prototype.decorate.call(this); | 41 ListItem.prototype.decorate.call(this); |
| 42 | 42 |
| 43 this.classList.add('deletable-item'); | 43 this.classList.add('deletable-item'); |
| 44 | 44 |
| 45 this.contentElement_ = this.ownerDocument.createElement('div'); | 45 this.contentElement_ = this.ownerDocument.createElement('div'); |
| 46 this.appendChild(this.contentElement_); | 46 this.appendChild(this.contentElement_); |
| 47 | 47 |
| 48 this.closeButtonElement_ = this.ownerDocument.createElement('button'); | 48 this.closeButtonElement_ = this.ownerDocument.createElement('button'); |
| 49 this.closeButtonElement_.className = | 49 this.closeButtonElement_.className = |
| 50 'raw-button close-button custom-appearance'; | 50 'raw-button row-delete-button custom-appearance'; |
| 51 this.closeButtonElement_.addEventListener('mousedown', | 51 this.closeButtonElement_.addEventListener('mousedown', |
| 52 this.handleMouseDownUpOnClose_); | 52 this.handleMouseDownUpOnClose_); |
| 53 this.closeButtonElement_.addEventListener('mouseup', | 53 this.closeButtonElement_.addEventListener('mouseup', |
| 54 this.handleMouseDownUpOnClose_); | 54 this.handleMouseDownUpOnClose_); |
| 55 this.closeButtonElement_.addEventListener('focus', | 55 this.closeButtonElement_.addEventListener('focus', |
| 56 this.handleFocus_.bind(this)); | 56 this.handleFocus_.bind(this)); |
| 57 this.appendChild(this.closeButtonElement_); | 57 this.appendChild(this.closeButtonElement_); |
| 58 }, | 58 }, |
| 59 | 59 |
| 60 /** | 60 /** |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 */ | 176 */ |
| 177 deleteItemAtIndex: function(index) { | 177 deleteItemAtIndex: function(index) { |
| 178 }, | 178 }, |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 return { | 181 return { |
| 182 DeletableItemList: DeletableItemList, | 182 DeletableItemList: DeletableItemList, |
| 183 DeletableItem: DeletableItem, | 183 DeletableItem: DeletableItem, |
| 184 }; | 184 }; |
| 185 }); | 185 }); |
| OLD | NEW |