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

Unified Diff: chrome/browser/resources/file_manager/js/scrollbar.js

Issue 15761006: Files.app: Prevent a scroolbar from overshooting the border of the view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/scrollbar.js
diff --git a/chrome/browser/resources/file_manager/js/scrollbar.js b/chrome/browser/resources/file_manager/js/scrollbar.js
index f20e7d9674d77afe0c460d23280b47ac21fad445..4094f44041fb930c3141fccbdca918d377e588bf 100644
--- a/chrome/browser/resources/file_manager/js/scrollbar.js
+++ b/chrome/browser/resources/file_manager/js/scrollbar.js
@@ -152,6 +152,9 @@ ScrollBar.prototype.onMouseMove_ = function(event) {
var buttonPosition = this.buttonPressedPosition_ +
(event.screenY - this.buttonPressedEvent_.screenY);
+ // Ensures the scrollbar is in the view.
+ buttonPosition =
+ Math.max(0, Math.min(buttonPosition, clientSize - buttonSize));
var scrollPosition = totalSize * (buttonPosition / clientSize);
this.scrollTop_ = scrollPosition;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698