Bug 1336434 - "Your Top Sites" heading should say "Top Sites" instead when using the default set. r=Gijs, a=jcristau
--- a/browser/base/content/newtab/grid.js
+++ b/browser/base/content/newtab/grid.js
@@ -137,27 +137,34 @@ var gGrid = {
// Create cells.
let cells = Array.from(fragment.childNodes, (cell) => new Cell(this, cell));
// Fetch links.
let links = gLinks.getLinks();
// Create sites.
let numLinks = Math.min(links.length, cells.length);
+ let hasHistoryTiles = false;
for (let i = 0; i < numLinks; i++) {
if (links[i]) {
this.createSite(links[i], cells[i]);
+ if (links[i].type == "history") {
+ hasHistoryTiles = true;
+ }
}
}
this._cells = cells;
while (this._gridDefaultContent.nextSibling) {
this._gridDefaultContent.nextSibling.remove();
}
this._node.appendChild(fragment);
+
+ document.getElementById("topsites-heading").textContent =
+ hasHistoryTiles ? "Your Top Sites" : "Top Sites";
},
/**
* Calculate the height for a number of rows up to the maximum rows
* @param rows Number of rows defaulting to the max
*/
_computeHeight: function Grid_computeHeight(aRows) {
let {gridRows} = gGridPrefs;
--- a/browser/base/content/newtab/newTab.xhtml
+++ b/browser/base/content/newtab/newTab.xhtml
@@ -75,17 +75,17 @@
<input id="newtab-search-submit" type="button"
title="&contentSearchSubmit.tooltip;"/>
</div>
</div>
<div id="newtab-horizontal-margin">
<div class="newtab-side-margin"/>
<div id="newtab-grid">
- <h1 id="topsites-heading">Your Top Sites</h1>
+ <h1 id="topsites-heading"/>
</div>
<div class="newtab-side-margin"/>
</div>
<div id="newtab-margin-bottom"/>
</div>
<input id="newtab-customize-button" type="button" dir="&locale.dir;"
value="⚙"