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 cr.define('ntp4', function() { | 5 cr.define('ntp4', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var localStrings = new LocalStrings; | 8 var localStrings = new LocalStrings; |
9 | 9 |
10 var APP_LAUNCH = { | 10 var APP_LAUNCH = { |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
405 this.classList.add('apps-page'); | 405 this.classList.add('apps-page'); |
406 }, | 406 }, |
407 | 407 |
408 /** | 408 /** |
409 * Creates an app DOM element and places it at the last position on the | 409 * Creates an app DOM element and places it at the last position on the |
410 * page. | 410 * page. |
411 * @param {Object} appData The data object that describes the app. | 411 * @param {Object} appData The data object that describes the app. |
412 * @param {?boolean} animate If true, the app tile plays an animation. | 412 * @param {?boolean} animate If true, the app tile plays an animation. |
413 */ | 413 */ |
414 appendApp: function(appData, animate) { | 414 appendApp: function(appData, animate) { |
415 if (animate) { | |
416 // Select the page and scroll all the way down so the animation is | |
417 // visible. | |
418 ntp4.getCardSlider().selectCardByValue(this); | |
419 console.log('selecting card'); | |
Rick Byers
2011/08/29 16:01:00
We don't generally want to leave diagnostic loggin
Evan Stade
2011/08/29 18:15:16
correct, left here by mistake
| |
420 this.content_.scrollTop = this.content_.scrollHeight; | |
421 } | |
415 this.appendTile(new App(appData), animate); | 422 this.appendTile(new App(appData), animate); |
416 }, | 423 }, |
417 | 424 |
418 /** @inheritdoc */ | 425 /** @inheritdoc */ |
419 doDragOver: function(e) { | 426 doDragOver: function(e) { |
420 var tile = ntp4.getCurrentlyDraggingTile(); | 427 var tile = ntp4.getCurrentlyDraggingTile(); |
421 if (!tile.querySelector('.app')) { | 428 if (!tile.querySelector('.app')) { |
422 e.preventDefault(); | 429 e.preventDefault(); |
423 this.setDropEffect(e.dataTransfer); | 430 this.setDropEffect(e.dataTransfer); |
424 } else { | 431 } else { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 var store = document.querySelector('.webstore'); | 539 var store = document.querySelector('.webstore'); |
533 if (store) | 540 if (store) |
534 store.setAppsPromoData(data); | 541 store.setAppsPromoData(data); |
535 }; | 542 }; |
536 | 543 |
537 return { | 544 return { |
538 APP_LAUNCH: APP_LAUNCH, | 545 APP_LAUNCH: APP_LAUNCH, |
539 AppsPage: AppsPage, | 546 AppsPage: AppsPage, |
540 }; | 547 }; |
541 }); | 548 }); |
OLD | NEW |