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 0849e5bb26c8dfb2a0f4e5ae0872d3db63a80dea..c327386ebddf9bf24ae2717d9adde501b62a6227 100644 |
| --- a/ui/webui/resources/js/cr/ui/list.js |
| +++ b/ui/webui/resources/js/cr/ui/list.js |
| @@ -719,12 +719,11 @@ cr.define('cr.ui', function() { |
| /** |
| * Ensures that a given index is inside the viewport. |
| * @param {number} index The index of the item to scroll into view. |
| - * @return {boolean} Whether any scrolling was needed. |
| */ |
| scrollIndexIntoView: function(index) { |
| var dataModel = this.dataModel; |
| if (!dataModel || index < 0 || index >= dataModel.length) |
| - return false; |
| + return; |
| var itemHeight = this.getItemHeightByIndex_(index); |
| var scrollTop = this.scrollTop; |
| @@ -740,27 +739,24 @@ cr.define('cr.ui', function() { |
| // Function to adjust the tops of viewport and row. |
| function scrollToAdjustTop() { |
| self.scrollTop = top; |
| - return true; |
| }; |
|
Dan Beam
2015/10/20 00:33:38
while you're here, can you fix this indent and rem
fukino
2015/10/20 04:13:08
Done.
Dan Beam
2015/10/21 01:35:26
what about the indent?
|
| // Function to adjust the bottoms of viewport and row. |
| function scrollToAdjustBottom() { |
| self.scrollTop = top + itemHeight - availableHeight; |
| - return true; |
| }; |
| // Check if the entire of given indexed row can be shown in the viewport. |
| if (itemHeight <= availableHeight) { |
| if (top < scrollTop) |
| - return scrollToAdjustTop(); |
| - if (scrollTop + availableHeight < top + itemHeight) |
| - return scrollToAdjustBottom(); |
| + scrollToAdjustTop(); |
| + else if (scrollTop + availableHeight < top + itemHeight) |
| + scrollToAdjustBottom(); |
| } else { |
| if (scrollTop < top) |
| - return scrollToAdjustTop(); |
| - if (top + itemHeight < scrollTop + availableHeight) |
| - return scrollToAdjustBottom(); |
| + scrollToAdjustTop(); |
| + else if (top + itemHeight < scrollTop + availableHeight) |
| + scrollToAdjustBottom(); |
| } |
| - return false; |
| }, |
| /** |