| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 List = cr.ui.List; | 6 const List = cr.ui.List; |
| 7 const ListItem = cr.ui.ListItem; | 7 const 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 /** @inheritDoc */ | 52 /** @inheritDoc */ |
| 53 decorate: function() { | 53 decorate: function() { |
| 54 ListItem.prototype.decorate.call(this); | 54 ListItem.prototype.decorate.call(this); |
| 55 | 55 |
| 56 this.classList.add('deletable-item'); | 56 this.classList.add('deletable-item'); |
| 57 | 57 |
| 58 this.contentElement_ = this.ownerDocument.createElement('div'); | 58 this.contentElement_ = this.ownerDocument.createElement('div'); |
| 59 this.appendChild(this.contentElement_); | 59 this.appendChild(this.contentElement_); |
| 60 | 60 |
| 61 this.closeButtonElement_ = this.ownerDocument.createElement('button'); | 61 this.closeButtonElement_ = this.ownerDocument.createElement('button'); |
| 62 this.closeButtonElement_.className = 'close-button'; | 62 this.closeButtonElement_.classList.add('raw-button'); |
| 63 this.closeButtonElement_.classList.add('close-button'); |
| 63 this.closeButtonElement_.addEventListener('mousedown', | 64 this.closeButtonElement_.addEventListener('mousedown', |
| 64 this.handleMouseDownUpOnClose_); | 65 this.handleMouseDownUpOnClose_); |
| 65 this.closeButtonElement_.addEventListener('mouseup', | 66 this.closeButtonElement_.addEventListener('mouseup', |
| 66 this.handleMouseDownUpOnClose_); | 67 this.handleMouseDownUpOnClose_); |
| 67 this.appendChild(this.closeButtonElement_); | 68 this.appendChild(this.closeButtonElement_); |
| 68 }, | 69 }, |
| 69 | 70 |
| 70 /** | 71 /** |
| 71 * Returns the element subclasses should add content to. | 72 * Returns the element subclasses should add content to. |
| 72 * @return {HTMLElement} The element subclasses should popuplate. | 73 * @return {HTMLElement} The element subclasses should popuplate. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 */ | 146 */ |
| 146 deleteItemAtIndex: function(index) { | 147 deleteItemAtIndex: function(index) { |
| 147 }, | 148 }, |
| 148 }; | 149 }; |
| 149 | 150 |
| 150 return { | 151 return { |
| 151 DeletableItemList: DeletableItemList, | 152 DeletableItemList: DeletableItemList, |
| 152 DeletableItem: DeletableItem, | 153 DeletableItem: DeletableItem, |
| 153 }; | 154 }; |
| 154 }); | 155 }); |
| OLD | NEW |