Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 cr.define('options', function() { | |
| 6 /** @const */ List = cr.ui.List; | |
| 7 /** @const */ ListItem = cr.ui.ListItem; | |
| 8 /** @const */ ArrayDataModel = cr.ui.ArrayDataModel; | |
|
Dan Beam
2014/07/10 02:57:23
ArrayDataModel, InlineEditeableItem{,List} are unu
Daniel Nishi
2014/07/10 19:00:07
Whoops. Removed the holdovers from a previous impl
| |
| 9 var InlineEditableItemList = options.InlineEditableItemList; | |
| 10 var InlineEditableItem = options.InlineEditableItem; | |
| 11 | |
| 12 function OriginListItem(origin) { | |
| 13 var el = cr.doc.createElement('div'); | |
|
Dan Beam
2014/07/10 02:57:23
why can't you just do
var listItem = new Origin
Daniel Nishi
2014/07/10 19:00:08
That would cause an infinite loop calling the cons
| |
| 14 el.origin_ = origin; | |
| 15 OriginListItem.decorate(el); | |
| 16 return el; | |
| 17 }; | |
|
Dan Beam
2014/07/10 02:57:23
}; -> }
Daniel Nishi
2014/07/10 19:00:08
Done.
| |
| 18 | |
| 19 OriginListItem.decorate = function(el) { | |
| 20 el.__proto__ = OriginListItem.prototype; | |
| 21 el.decorate(); | |
| 22 } | |
|
Dan Beam
2014/07/10 02:57:23
};
Dan Beam
2014/07/10 02:57:23
indent off
Daniel Nishi
2014/07/10 19:00:07
Done.
Daniel Nishi
2014/07/10 19:00:08
Done.
| |
| 23 | |
| 24 OriginListItem.prototype = { | |
| 25 __proto__: ListItem.prototype, | |
| 26 | |
|
Dan Beam
2014/07/10 02:57:23
does this need /** @override */?
Daniel Nishi
2014/07/10 19:00:08
I think so.
Done.
| |
| 27 decorate: function() { | |
| 28 ListItem.prototype.decorate.call(this); | |
| 29 | |
| 30 this.classList.add('deletable-item'); | |
| 31 | |
| 32 this.contentElement_ = this.ownerDocument.createElement('div'); | |
| 33 this.appendChild(this.contentElement_); | |
| 34 | |
| 35 var container = this.ownerDocument.createElement('div'); | |
|
Dan Beam
2014/07/10 02:57:23
inline |container| or at least move lower
Bernhard Bauer
2014/07/10 08:47:42
Yeah, it doesn't really seem to be used at all.
Daniel Nishi
2014/07/10 19:00:07
Removed the container.
Daniel Nishi
2014/07/10 19:00:08
Done.
| |
| 36 | |
| 37 var titleEl = this.ownerDocument.createElement('div'); | |
| 38 titleEl.className = 'title'; | |
|
Dan Beam
2014/07/10 02:57:23
titleEl.className = 'title favicon-cell weakrtl';
Daniel Nishi
2014/07/10 19:00:08
Done.
| |
| 39 titleEl.classList.add('favicon-cell'); | |
| 40 titleEl.classList.add('weakrtl'); | |
| 41 titleEl.textContent = this.origin_; | |
| 42 titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); | |
| 43 this.contentElement_.appendChild(titleEl); | |
| 44 this.contentElement_.appendChild(container); | |
| 45 } | |
| 46 }; | |
| 47 | |
| 48 var OriginList = cr.ui.define('list'); | |
| 49 | |
| 50 OriginList.prototype = { | |
| 51 __proto__: List.prototype, | |
| 52 | |
| 53 /** @override */ | |
| 54 createItem: function(entry) { | |
| 55 return new OriginListItem(entry); | |
| 56 }, | |
| 57 }; | |
| 58 | |
| 59 return { | |
| 60 OriginListItem: OriginListItem, | |
| 61 OriginList: OriginList, | |
| 62 }; | |
| 63 }); | |
| OLD | NEW |