summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-18 00:06:12 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-18 00:06:12 +0000
commit493a5a69ba9edbdf7053e04dee2f4af451677aec (patch)
tree3fcabe3cf0dd3dd09643e2e41470a84f35cae1fa
parent82145aec2ffbdbfe136e4fcc6a551f5da82b9b9b (diff)
downloadchromium_src-493a5a69ba9edbdf7053e04dee2f4af451677aec.zip
chromium_src-493a5a69ba9edbdf7053e04dee2f4af451677aec.tar.gz
chromium_src-493a5a69ba9edbdf7053e04dee2f4af451677aec.tar.bz2
Merge 59870 - Scroll to the top when toggling sections on the NTP.
BUG=56075 TEST=Open NTP. Make window small enough to scroll. Open a different section, then reopen the original section. Scroll should have returned to top. Review URL: http://codereview.chromium.org/3415016 TBR=aa@chromium.org Review URL: http://codereview.chromium.org/3454009 git-svn-id: svn://svn.chromium.org/chrome/branches/517/src@59881 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/new_new_tab.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 743e5af..1fa8ca9 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -683,6 +683,9 @@ function toggleSectionVisibilityAndAnimate(section) {
if (!section)
return;
+ // It looks better to return the scroll to the top when toggling sections.
+ document.body.scrollTop = 0;
+
// We set it back in webkitTransitionEnd.
document.documentElement.setAttribute('enable-section-animations', 'true');
if (shownSections & Section[section]) {