OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more | 5 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more |
6 // than this many items in the miniview. | 6 // than this many items in the miniview. |
7 var MAX_MINIVIEW_ITEMS = 15; | 7 var MAX_MINIVIEW_ITEMS = 15; |
8 | 8 |
9 // Extra spacing at the top of the layout. | 9 // Extra spacing at the top of the layout. |
10 var LAYOUT_SPACING_TOP = 25; | 10 var LAYOUT_SPACING_TOP = 25; |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 if (mostVisited.data && apps.loaded) | 1372 if (mostVisited.data && apps.loaded) |
1373 document.body.classList.remove('loading'); | 1373 document.body.classList.remove('loading'); |
1374 } | 1374 } |
1375 | 1375 |
1376 function isDoneLoading() { | 1376 function isDoneLoading() { |
1377 return !document.body.classList.contains('loading'); | 1377 return !document.body.classList.contains('loading'); |
1378 } | 1378 } |
1379 | 1379 |
1380 // Initialize the apps promo. | 1380 // Initialize the apps promo. |
1381 document.addEventListener('DOMContentLoaded', function() { | 1381 document.addEventListener('DOMContentLoaded', function() { |
1382 var promoText1 = $('apps-promo-text1'); | 1382 var promoLink = document.querySelector('#apps-promo-text1 a'); |
1383 promoText1.innerHTML = promoText1.textContent; | |
1384 | |
1385 var promoLink = promoText1.querySelector('a'); | |
1386 promoLink.id = 'apps-promo-link'; | 1383 promoLink.id = 'apps-promo-link'; |
1387 promoLink.href = localStrings.getString('web_store_url'); | 1384 promoLink.href = localStrings.getString('web_store_url'); |
1388 | 1385 |
1389 $('apps-promo-hide').addEventListener('click', function() { | 1386 $('apps-promo-hide').addEventListener('click', function() { |
1390 chrome.send('hideAppsPromo', []); | 1387 chrome.send('hideAppsPromo', []); |
1391 document.documentElement.classList.remove('apps-promo-visible'); | 1388 document.documentElement.classList.remove('apps-promo-visible'); |
1392 layoutSections(); | 1389 layoutSections(); |
1393 }); | 1390 }); |
1394 }); | 1391 }); |
OLD | NEW |