diff options
Diffstat (limited to 'application/palemoon/base/content/newtab/grid.js')
-rw-r--r-- | application/palemoon/base/content/newtab/grid.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/base/content/newtab/grid.js index 37559a063..a614d0396 100644 --- a/application/palemoon/base/content/newtab/grid.js +++ b/application/palemoon/base/content/newtab/grid.js @@ -7,7 +7,7 @@ /** * This singleton represents the grid that contains all sites. */ -let gGrid = { +var gGrid = { /** * The DOM node of the grid. */ @@ -59,8 +59,13 @@ let gGrid = { * Refreshes the grid and re-creates all sites. */ refresh: function Grid_refresh() { + let cells = this.cells; + if (!cells) { + return; + } + // Remove all sites. - this.cells.forEach(function (cell) { + cells.forEach(function (cell) { let node = cell.node; let child = node.firstElementChild; @@ -109,7 +114,12 @@ let gGrid = { // (Re-)initialize all cells. let cellElements = this.node.querySelectorAll(".newtab-cell"); - this._cells = [new Cell(this, cell) for (cell of cellElements)]; + // Tycho: this._cells = [new Cell(this, cell) for (cell of cellElements)]; + this.cells = []; + + for (let cellItem of cellElements) { + this.cells.push(new Cell(this, cellItem)); + } }, /** |