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 = | |
Evan Stade
2011/08/18 00:40:01
I'm not sure but I think that this will force a re
csilv
2011/08/18 18:10:36
Re-worked, PTAL.
| |
557 pageSwitcherLeft.style.paddingBottom = | |
558 pageSwitcherRight.style.paddingBottom = | |
559 page.querySelector('.tile-page-content').offsetTop + 'px'; | |
556 } | 560 } |
557 | 561 |
558 /** | 562 /** |
559 * Returns the index of the given page. | 563 * Returns the index of the given page. |
560 * @param {AppsPage} page The AppsPage for we wish to find. | 564 * @param {AppsPage} page The AppsPage for we wish to find. |
561 * @return {number} The index of |page|, or -1 if it is not here. | 565 * @return {number} The index of |page|, or -1 if it is not here. |
562 */ | 566 */ |
563 function getAppsPageIndex(page) { | 567 function getAppsPageIndex(page) { |
564 return Array.prototype.indexOf.call(appsPages, page); | 568 return Array.prototype.indexOf.call(appsPages, page); |
565 } | 569 } |
(...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 | 742 // TODO(estade): update the content handlers to use ntp namespace instead of |
739 // making these global. | 743 // making these global. |
740 var assert = ntp4.assert; | 744 var assert = ntp4.assert; |
741 var getAppsCallback = ntp4.getAppsCallback; | 745 var getAppsCallback = ntp4.getAppsCallback; |
742 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 746 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
743 var themeChanged = ntp4.themeChanged; | 747 var themeChanged = ntp4.themeChanged; |
744 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 748 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
745 var setMostVisitedPages = ntp4.setMostVisitedPages; | 749 var setMostVisitedPages = ntp4.setMostVisitedPages; |
746 | 750 |
747 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 751 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
OLD | NEW |