Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3016)

Unified Diff: chrome/browser/resources/ntp_search/apps_page.js

Issue 11445009: NTP5: Reuse insertion/removal animations for Apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NTP5: Reuse insertion/removal animations for Apps Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/ntp_search/apps_page.js
diff --git a/chrome/browser/resources/ntp_search/apps_page.js b/chrome/browser/resources/ntp_search/apps_page.js
index 430ae739a45dba5e2ad18518ec98ae9022bb7311..21c40213361bd2f7a32474af1c2894a4a18237ba 100644
--- a/chrome/browser/resources/ntp_search/apps_page.js
+++ b/chrome/browser/resources/ntp_search/apps_page.js
@@ -292,7 +292,15 @@ cr.define('ntp', function() {
// Unset the ID immediately, because the app is already gone. But leave
// the tile on the page as it animates out.
this.id = '';
- this.tileCell.doRemove(opt_animate);
+
+ if (opt_animate) {
+ var cell = this.tileCell;
+ var tilePage = cell.tilePage;
+ tilePage.dataList_.splice(cell.index, 1);
+ tilePage.animateTileRemoval(cell.index, tilePage.dataList_);
+ } else {
+ this.tileCell.doRemove(opt_animate);
+ }
},
/**
@@ -581,7 +589,7 @@ cr.define('ntp', function() {
// The width of a cell.
cellWidth: 70,
// The start margin of a cell (left or right according to text direction).
- cellMarginStart: 22,
+ cellMarginStart: 20,
// The maximum number of Tiles to be displayed.
maxTileCount: 20,
// Whether the TilePage content will be scrollable.
@@ -628,9 +636,13 @@ cr.define('ntp', function() {
}
}
- var app = new App(data);
- this.addTileAt(app, index);
- this.renderGrid_();
+ if (animate) {
+ this.dataList_.splice(index, 0, data);
+ this.animateTileRestoration(index, this.dataList_);
+ } else {
+ var app = new App(data);
+ this.addTileAt(app, index);
+ }
},
/**
« no previous file with comments | « chrome/browser/resources/ntp_search/apps_page.css ('k') | chrome/browser/resources/ntp_search/most_visited_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698