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

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

Issue 68723003: Make chrome/ be documentElement/body agnostic with regards to scrollTop/Left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_305800
Patch Set: Created 7 years, 1 month 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
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 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 function updatePaneOnHash() { 2146 function updatePaneOnHash() {
2147 var paneIndex = getPaneIndexFromHash(); 2147 var paneIndex = getPaneIndexFromHash();
2148 var pane = panes[paneIndex]; 2148 var pane = panes[paneIndex];
2149 2149
2150 if (currentPane) 2150 if (currentPane)
2151 currentPane.classList.remove('selected'); 2151 currentPane.classList.remove('selected');
2152 pane.classList.add('selected'); 2152 pane.classList.add('selected');
2153 currentPane = pane; 2153 currentPane = pane;
2154 currentPaneIndex = paneIndex; 2154 currentPaneIndex = paneIndex;
2155 2155
2156 document.documentElement.scrollTop = 0; 2156 setScrollTopForDocument(document, 0);
2157 2157
2158 var panelPrefix = sectionPrefixes[paneIndex]; 2158 var panelPrefix = sectionPrefixes[paneIndex];
2159 var title = templateData[panelPrefix + '_document_title']; 2159 var title = templateData[panelPrefix + '_document_title'];
2160 if (!title) 2160 if (!title)
2161 title = templateData['title']; 2161 title = templateData['title'];
2162 document.title = title; 2162 document.title = title;
2163 2163
2164 sendNTPTitleLoadedNotification(); 2164 sendNTPTitleLoadedNotification();
2165 2165
2166 // TODO (dtrainor): Could potentially add logic to reset the bookmark state 2166 // TODO (dtrainor): Could potentially add logic to reset the bookmark state
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 // NTP Entry point. 2723 // NTP Entry point.
2724 ///////////////////////////////////////////////////////////////////////////// 2724 /////////////////////////////////////////////////////////////////////////////
2725 2725
2726 /* 2726 /*
2727 * Handles initializing the UI when the page has finished loading. 2727 * Handles initializing the UI when the page has finished loading.
2728 */ 2728 */
2729 window.addEventListener('DOMContentLoaded', function(evt) { 2729 window.addEventListener('DOMContentLoaded', function(evt) {
2730 ntp.init(); 2730 ntp.init();
2731 $('content-area').style.display = 'block'; 2731 $('content-area').style.display = 'block';
2732 }); 2732 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp_android/new_tab.html ('k') | chrome/browser/resources/options/options_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698