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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 | 546 |
547 var pageSwitcherLeft = isRTL() ? pageSwitcherEnd : pageSwitcherStart; | 547 var pageSwitcherLeft = isRTL() ? pageSwitcherEnd : pageSwitcherStart; |
548 var pageSwitcherRight = isRTL() ? pageSwitcherStart : pageSwitcherEnd; | 548 var pageSwitcherRight = isRTL() ? pageSwitcherStart : pageSwitcherEnd; |
549 var scrollbarWidth = page.scrollbarWidth; | 549 var scrollbarWidth = page.scrollbarWidth; |
550 pageSwitcherLeft.style.width = | 550 pageSwitcherLeft.style.width = |
551 (page.sideMargin + 13) + 'px'; | 551 (page.sideMargin + 13) + 'px'; |
552 pageSwitcherLeft.style.left = '0'; | 552 pageSwitcherLeft.style.left = '0'; |
553 pageSwitcherRight.style.width = | 553 pageSwitcherRight.style.width = |
554 (page.sideMargin - scrollbarWidth + 13) + 'px'; | 554 (page.sideMargin - scrollbarWidth + 13) + 'px'; |
555 pageSwitcherRight.style.right = scrollbarWidth + 'px'; | 555 pageSwitcherRight.style.right = scrollbarWidth + 'px'; |
556 pageSwitcherLeft.style.top = pageSwitcherRight.style.top = | |
557 page.querySelector('.tile-page-content').offsetTop + 'px'; | |
Evan Stade
2011/08/17 21:04:29
I think you should set an equal margin on the bott
csilv
2011/08/17 23:05:58
Done. The padding-bottom is what works for this.
| |
556 } | 558 } |
557 | 559 |
558 /** | 560 /** |
559 * Returns the index of the given page. | 561 * Returns the index of the given page. |
560 * @param {AppsPage} page The AppsPage for we wish to find. | 562 * @param {AppsPage} page The AppsPage for we wish to find. |
561 * @return {number} The index of |page|, or -1 if it is not here. | 563 * @return {number} The index of |page|, or -1 if it is not here. |
562 */ | 564 */ |
563 function getAppsPageIndex(page) { | 565 function getAppsPageIndex(page) { |
564 return Array.prototype.indexOf.call(appsPages, page); | 566 return Array.prototype.indexOf.call(appsPages, page); |
565 } | 567 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
738 // TODO(estade): update the content handlers to use ntp namespace instead of | 740 // TODO(estade): update the content handlers to use ntp namespace instead of |
739 // making these global. | 741 // making these global. |
740 var assert = ntp4.assert; | 742 var assert = ntp4.assert; |
741 var getAppsCallback = ntp4.getAppsCallback; | 743 var getAppsCallback = ntp4.getAppsCallback; |
742 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 744 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
743 var themeChanged = ntp4.themeChanged; | 745 var themeChanged = ntp4.themeChanged; |
744 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 746 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
745 var setMostVisitedPages = ntp4.setMostVisitedPages; | 747 var setMostVisitedPages = ntp4.setMostVisitedPages; |
746 | 748 |
747 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 749 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
OLD | NEW |