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

Side by Side Diff: chrome/browser/resources/ntp_android/ntp_android.js

Issue 26865003: Fix android NTP's scroll to top of page logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // File Description: 5 // File Description:
6 // Contains all the necessary functions for rendering the NTP on mobile 6 // Contains all the necessary functions for rendering the NTP on mobile
7 // devices. 7 // devices.
8 8
9 /** 9 /**
10 * The event type used to determine when a touch starts. 10 * The event type used to determine when a touch starts.
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 function updatePaneOnHash() { 2148 function updatePaneOnHash() {
2149 var paneIndex = getPaneIndexFromHash(); 2149 var paneIndex = getPaneIndexFromHash();
2150 var pane = panes[paneIndex]; 2150 var pane = panes[paneIndex];
2151 2151
2152 if (currentPane) 2152 if (currentPane)
2153 currentPane.classList.remove('selected'); 2153 currentPane.classList.remove('selected');
2154 pane.classList.add('selected'); 2154 pane.classList.add('selected');
2155 currentPane = pane; 2155 currentPane = pane;
2156 currentPaneIndex = paneIndex; 2156 currentPaneIndex = paneIndex;
2157 2157
2158 document.body.scrollTop = 0; 2158 document.documentElement.scrollTop = 0;
2159 2159
2160 var panelPrefix = sectionPrefixes[paneIndex]; 2160 var panelPrefix = sectionPrefixes[paneIndex];
2161 var title = templateData[panelPrefix + '_document_title']; 2161 var title = templateData[panelPrefix + '_document_title'];
2162 if (!title) 2162 if (!title)
2163 title = templateData['title']; 2163 title = templateData['title'];
2164 document.title = title; 2164 document.title = title;
2165 2165
2166 sendNTPTitleLoadedNotification(); 2166 sendNTPTitleLoadedNotification();
2167 2167
2168 // TODO (dtrainor): Could potentially add logic to reset the bookmark state 2168 // TODO (dtrainor): Could potentially add logic to reset the bookmark state
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 // NTP Entry point. 2725 // NTP Entry point.
2726 ///////////////////////////////////////////////////////////////////////////// 2726 /////////////////////////////////////////////////////////////////////////////
2727 2727
2728 /* 2728 /*
2729 * Handles initializing the UI when the page has finished loading. 2729 * Handles initializing the UI when the page has finished loading.
2730 */ 2730 */
2731 window.addEventListener('DOMContentLoaded', function(evt) { 2731 window.addEventListener('DOMContentLoaded', function(evt) {
2732 ntp.init(); 2732 ntp.init();
2733 $('content-area').style.display = 'block'; 2733 $('content-area').style.display = 'block';
2734 }); 2734 });
OLDNEW
« 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