Index: chrome/browser/resources/bluetooth_internals/expandable_list.js |
diff --git a/chrome/browser/resources/bluetooth_internals/expandable_list.js b/chrome/browser/resources/bluetooth_internals/expandable_list.js |
index e2d3be74e68da6c1f6b062d33d320f431c75e9c4..bbb8bcbeae01d2b3d6e5211f5efde02a24fb2a85 100644 |
--- a/chrome/browser/resources/bluetooth_internals/expandable_list.js |
+++ b/chrome/browser/resources/bluetooth_internals/expandable_list.js |
@@ -31,7 +31,7 @@ cr.define('expandable_list', function() { |
this.briefContent_ = document.createElement('div'); |
this.briefContent_.classList.add('brief-content'); |
this.briefContent_.addEventListener( |
- 'click', this.toggleExpand_.bind(this)); |
+ 'click', this.onExpand_.bind(this)); |
this.appendChild(this.briefContent_); |
this.expandedContent_ = document.createElement('div'); |
@@ -40,11 +40,17 @@ cr.define('expandable_list', function() { |
}, |
/** |
+ * Called when the list item is expanded or collapsed. |
+ * @param {boolean} expanded |
+ */ |
+ onExpandInternal: function(expanded) {}, |
+ |
+ /** |
* Toggles the expanded class on the item. |
* @private |
*/ |
- toggleExpand_: function() { |
- this.classList.toggle('expanded'); |
+ onExpand_: function() { |
+ this.onExpandInternal(this.classList.toggle('expanded')); |
}, |
}; |
@@ -111,6 +117,14 @@ cr.define('expandable_list', function() { |
}, |
/** |
+ * Gets the loading state of the list. Returns true if the list is loading. |
+ * @return {boolean} |
+ */ |
+ isLoading: function() { |
+ return !this.spinner_.hidden; |
+ }, |
+ |
+ /** |
* Updates the display state of the empty message. If there are no items in |
* the data model, the empty message is displayed. |
*/ |