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

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: Use type cast for createElement, fix indent. 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
« no previous file with comments | « ui/file_manager/video_player/js/compiled_resources.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c12088640464486827402a9ae117024c104c6e75 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;
@@ -739,28 +738,25 @@ cr.define('cr.ui', function() {
var self = this;
// Function to adjust the tops of viewport and row.
function scrollToAdjustTop() {
- self.scrollTop = top;
- return true;
- };
+ self.scrollTop = top;
+ }
// Function to adjust the bottoms of viewport and row.
function scrollToAdjustBottom() {
- self.scrollTop = top + itemHeight - availableHeight;
- return true;
- };
+ self.scrollTop = top + itemHeight - availableHeight;
+ }
// 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;
},
/**
« no previous file with comments | « ui/file_manager/video_player/js/compiled_resources.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698