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

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

Issue 11412214: NTP5: Fine tuning of Apps implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 2366e4c720b524e5213ddb4c30c7ea86ca970c2e..6905800cf1c7dba7c73ef582dc9603e186bdb164 100644
--- a/chrome/browser/resources/ntp_search/apps_page.js
+++ b/chrome/browser/resources/ntp_search/apps_page.js
@@ -576,14 +576,18 @@ cr.define('ntp', function() {
// wants the non-default behavior.
config: {
// The width of a cell.
- cellWidth: 77,
+ cellWidth: 70,
// The start margin of a cell (left or right according to text direction).
cellMarginStart: 12,
// The maximum number of Tiles to be displayed.
- maxTileCount: 20
+ maxTileCount: 20,
+ // Whether the TilePage content will be scrollable.
+ scrollable: true
Dan Beam 2012/11/29 04:59:55 nit: hanging "," IMO
pedro (no code reviews) 2012/11/29 08:02:37 Done.
},
initialize: function() {
+ TilePage.prototype.initialize.apply(this, arguments);
+
this.classList.add('apps-page');
this.addEventListener('cardselected', this.onCardSelected_);
@@ -595,8 +599,6 @@ cr.define('ntp', function() {
this.onCardChangeEnded_);
this.addEventListener('tilePage:tile_added', this.onTileAdded_);
-
- this.content_.addEventListener('scroll', this.onScroll_.bind(this));
},
/**
@@ -616,16 +618,7 @@ cr.define('ntp', function() {
* @param {boolean} animate Whether to animate the insertion.
*/
insertApp: function(appData, animate) {
- var index = this.tiles_.length;
- for (var i = 0; i < this.tiles_.length; i++) {
- if (appData.app_launch_ordinal <
- this.tiles_[i].appData.app_launch_ordinal) {
- index = i;
- break;
- }
- }
-
- this.addTileAt(new App(appData), index);
+ this.appendTile(new App(appData));
this.renderGrid_();
},
@@ -692,6 +685,8 @@ cr.define('ntp', function() {
onScroll_: function(e) {
if (!this.selected)
return;
+
+ TilePage.prototype.onScroll_.apply(this, arguments);
Dan Beam 2012/11/29 04:59:55 nit: I'd put super calls before if () returns; if
pedro (no code reviews) 2012/11/29 08:02:37 Done. I've also removed the selection check once t
for (var i = 0; i < this.tiles_.length; i++) {
var app = this.tiles_[i];
assert(app instanceof App);

Powered by Google App Engine
This is Rietveld 408576698