Chromium Code Reviews| Index: ui/webui/resources/js/cr/ui/list.js |
| diff --git a/ui/webui/resources/js/cr/ui/list.js b/ui/webui/resources/js/cr/ui/list.js |
| index 720f0704ee2d43203d0cc1f73242aaaca512882b..b8da10daa7e114a573887a55ddfe38301c44c45e 100644 |
| --- a/ui/webui/resources/js/cr/ui/list.js |
| +++ b/ui/webui/resources/js/cr/ui/list.js |
| @@ -145,13 +145,20 @@ cr.define('cr.ui', function() { |
| } |
| this.redraw(); |
| - } |
| + this.onSetDataModelComplete(); |
| + } |
|
Dan Beam
2014/10/18 01:35:45
indent off
bondd
2014/10/28 22:31:27
Done.
|
| }, |
| get dataModel() { |
| return this.dataModel_; |
| }, |
| + /** |
| + * May be overridden by subclasses to implement specialized behavior once |
| + * dataModel has been set. |
|
Dan Beam
2014/10/18 01:35:44
nit: Override to be notified when |this.dataModel|
bondd
2014/10/28 22:31:27
Done.
|
| + */ |
| + onSetDataModelComplete: function() { |
| + }, |
| /** |
| * Cached item for measuring the default item size by measureItem(). |
| @@ -173,7 +180,7 @@ cr.define('cr.ui', function() { |
| if (!this.boundHandleOnChange_) { |
| this.boundHandleOnChange_ = this.handleOnChange_.bind(this); |
| - this.boundHandleLeadChange_ = this.handleLeadChange_.bind(this); |
| + this.boundHandleLeadChange_ = this.handleLeadChange.bind(this); |
| } |
| if (oldSm) { |
| @@ -586,9 +593,8 @@ cr.define('cr.ui', function() { |
| /** |
| * Handles a change of the lead item from the selection model. |
| * @param {Event} pe The property change event. |
| - * @private |
| */ |
| - handleLeadChange_: function(pe) { |
| + handleLeadChange: function(pe) { |
|
bondd
2014/10/17 01:23:15
I made this public because I need to hook it in In
Dan Beam
2014/10/18 01:35:45
why can't the derived class just listen to 'leadCh
bondd
2014/10/29 21:12:39
Maybe you are confused about the inheritance here
|
| var element; |
| if (pe.oldValue != -1) { |
| if ((element = this.getListItemByIndex(pe.oldValue))) |