Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2300)

Unified Diff: ui/webui/resources/js/cr/ui/list.js

Issue 1408533002: Turn on verbose flag for compiling file_manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: List minimum set of externs in each gyp file, etc.. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f3d9a1cfcc35ede8e7a3c041e0536dc24fc727fb 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;
Dan Beam 2015/10/21 01:35:26 these should be 2 spaces less indented
fukino 2015/10/21 04:00:28 Sorry! I forgot to fix these indents. Done.
- return true;
- };
+ }
// 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;
},
/**

Powered by Google App Engine
This is Rietveld 408576698