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 var MAX_APPS_PER_ROW = 6; | 5 var MAX_APPS_PER_ROW = 6; |
6 | 6 |
7 // We offset the webstore icon horizontally during promo and it only fits if | 7 // We offset the webstore icon horizontally during promo and it only fits if |
8 // there are two columns of space. Since one column is always reserved for the | 8 // there are two columns of space. Since one column is always reserved for the |
9 // webstore icon, we only need to subtract one from the normal maximum. | 9 // webstore icon, we only need to subtract one from the normal maximum. |
10 var MAX_PROMO_APPS = MAX_APPS_PER_ROW - 1; | 10 var MAX_PROMO_APPS = MAX_APPS_PER_ROW - 1; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 createElement: function(app) { | 237 createElement: function(app) { |
238 var div = createElement(app); | 238 var div = createElement(app); |
239 var a = div.firstChild; | 239 var a = div.firstChild; |
240 | 240 |
241 a.onclick = handleClick; | 241 a.onclick = handleClick; |
242 a.style.backgroundImage = url(app['icon_big']); | 242 a.style.backgroundImage = url(app['icon_big']); |
243 if (hashParams['app-id'] == app['id']) { | 243 if (hashParams['app-id'] == app['id']) { |
244 div.setAttribute('new', 'new'); | 244 div.setAttribute('new', 'new'); |
245 // Delay changing the attribute a bit to let the page settle down a bit. | 245 // Delay changing the attribute a bit to let the page settle down a bit. |
246 setTimeout(function() { | 246 setTimeout(function() { |
| 247 // Make sure the new icon is scrolled into view. |
| 248 document.body.scrollTop = document.body.scrollHeight; |
| 249 |
247 // This will trigger the 'bounce' animation defined in apps.css. | 250 // This will trigger the 'bounce' animation defined in apps.css. |
248 div.setAttribute('new', 'installed'); | 251 div.setAttribute('new', 'installed'); |
249 }, 500); | 252 }, 500); |
250 div.addEventListener('webkitAnimationEnd', function(e) { | 253 div.addEventListener('webkitAnimationEnd', function(e) { |
251 div.removeAttribute('new'); | 254 div.removeAttribute('new'); |
252 | 255 |
253 // If we get new data (eg because something installs in another tab, | 256 // If we get new data (eg because something installs in another tab, |
254 // or because we uninstall something here), don't run the install | 257 // or because we uninstall something here), don't run the install |
255 // animation again. | 258 // animation again. |
256 document.documentElement.setAttribute("install-animation-enabled", | 259 document.documentElement.setAttribute("install-animation-enabled", |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 var elm = createElement({ | 309 var elm = createElement({ |
307 'id': 'web-store-entry', | 310 'id': 'web-store-entry', |
308 'name': localStrings.getString('web_store_title'), | 311 'name': localStrings.getString('web_store_title'), |
309 'launch_url': localStrings.getString('web_store_url') | 312 'launch_url': localStrings.getString('web_store_url') |
310 }); | 313 }); |
311 elm.setAttribute('app-id', 'web-store-entry'); | 314 elm.setAttribute('app-id', 'web-store-entry'); |
312 return elm; | 315 return elm; |
313 } | 316 } |
314 }; | 317 }; |
315 })(); | 318 })(); |
OLD | NEW |