OLD | NEW |
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 /** | 5 /** |
6 * @fileoverview New tab page | 6 * @fileoverview New tab page |
7 * This is the main code for the new tab page used by touch-enabled Chrome | 7 * This is the main code for the new tab page used by touch-enabled Chrome |
8 * browsers. For now this is still a prototype. | 8 * browsers. For now this is still a prototype. |
9 */ | 9 */ |
10 | 10 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 548 |
549 var pageSwitcherLeft = isRTL() ? pageSwitcherEnd : pageSwitcherStart; | 549 var pageSwitcherLeft = isRTL() ? pageSwitcherEnd : pageSwitcherStart; |
550 var pageSwitcherRight = isRTL() ? pageSwitcherStart : pageSwitcherEnd; | 550 var pageSwitcherRight = isRTL() ? pageSwitcherStart : pageSwitcherEnd; |
551 var scrollbarWidth = page.scrollbarWidth; | 551 var scrollbarWidth = page.scrollbarWidth; |
552 pageSwitcherLeft.style.width = | 552 pageSwitcherLeft.style.width = |
553 (page.sideMargin + 13) + 'px'; | 553 (page.sideMargin + 13) + 'px'; |
554 pageSwitcherLeft.style.left = '0'; | 554 pageSwitcherLeft.style.left = '0'; |
555 pageSwitcherRight.style.width = | 555 pageSwitcherRight.style.width = |
556 (page.sideMargin - scrollbarWidth + 13) + 'px'; | 556 (page.sideMargin - scrollbarWidth + 13) + 'px'; |
557 pageSwitcherRight.style.right = scrollbarWidth + 'px'; | 557 pageSwitcherRight.style.right = scrollbarWidth + 'px'; |
| 558 |
| 559 var offsetTop = page.querySelector('.tile-page-content').offsetTop + 'px'; |
| 560 pageSwitcherLeft.style.top = offsetTop; |
| 561 pageSwitcherRight.style.top = offsetTop; |
| 562 pageSwitcherLeft.style.paddingBottom = offsetTop; |
| 563 pageSwitcherRight.style.paddingBottom = offsetTop; |
558 } | 564 } |
559 | 565 |
560 /** | 566 /** |
561 * Returns the index of the given page. | 567 * Returns the index of the given page. |
562 * @param {AppsPage} page The AppsPage for we wish to find. | 568 * @param {AppsPage} page The AppsPage for we wish to find. |
563 * @return {number} The index of |page|, or -1 if it is not here. | 569 * @return {number} The index of |page|, or -1 if it is not here. |
564 */ | 570 */ |
565 function getAppsPageIndex(page) { | 571 function getAppsPageIndex(page) { |
566 return Array.prototype.indexOf.call(appsPages, page); | 572 return Array.prototype.indexOf.call(appsPages, page); |
567 } | 573 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // TODO(estade): update the content handlers to use ntp namespace instead of | 746 // TODO(estade): update the content handlers to use ntp namespace instead of |
741 // making these global. | 747 // making these global. |
742 var assert = ntp4.assert; | 748 var assert = ntp4.assert; |
743 var getAppsCallback = ntp4.getAppsCallback; | 749 var getAppsCallback = ntp4.getAppsCallback; |
744 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 750 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
745 var themeChanged = ntp4.themeChanged; | 751 var themeChanged = ntp4.themeChanged; |
746 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 752 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
747 var setMostVisitedPages = ntp4.setMostVisitedPages; | 753 var setMostVisitedPages = ntp4.setMostVisitedPages; |
748 | 754 |
749 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 755 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
OLD | NEW |