summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/ntp4/tile_page.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/resources/ntp4/tile_page.js')
-rw-r--r--chrome/browser/resources/ntp4/tile_page.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/resources/ntp4/tile_page.js b/chrome/browser/resources/ntp4/tile_page.js
index 40a9398..7a79c0b 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -973,7 +973,9 @@ cr.define('ntp', function() {
// be 1/3 down the page.
var numTiles = this.tileCount +
(this.isCurrentDragTarget && !this.withinPageDrag_ ? 1 : 0);
- var numRows = Math.ceil(numTiles / layout.numRowTiles);
+ // Minimum of 1 row (this can come into play when there is an app install
+ // hint hiding the webstore tile, and there are no other tiles).
+ var numRows = Math.max(1, Math.ceil(numTiles / layout.numRowTiles));
var usedHeight = layout.rowHeight * numRows;
// 60 matches the top padding of tile-page (which acts as the minimum).
var newMargin = document.documentElement.clientHeight / 3 -