summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:59:33 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 22:59:33 +0000
commitbe825e07f72cada135d8fca0130bb2beccc0374c (patch)
tree76773df4ad96ae46b13dddb2a0494058c6554ae8
parent7307035b2c12088ba241dc49098204d4beff52d4 (diff)
downloadchromium_src-be825e07f72cada135d8fca0130bb2beccc0374c.zip
chromium_src-be825e07f72cada135d8fca0130bb2beccc0374c.tar.gz
chromium_src-be825e07f72cada135d8fca0130bb2beccc0374c.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59870 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 4d5eacb..8a2691d 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]) {