summaryrefslogtreecommitdiffstats
path: root/application/basilisk/base/content/newtab/page.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-06-29 17:41:18 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-06-29 17:41:18 +0200
commit51792b31a36b9539fdd1b4b85abe486c1652b6c4 (patch)
treee390cc9ab03d5fb0035eae376ce865297280d148 /application/basilisk/base/content/newtab/page.js
parent65b4a8ac5e784fbc0ba9a45784c910890730da4f (diff)
downloadUXP-51792b31a36b9539fdd1b4b85abe486c1652b6c4.tar
UXP-51792b31a36b9539fdd1b4b85abe486c1652b6c4.tar.gz
UXP-51792b31a36b9539fdd1b4b85abe486c1652b6c4.tar.lz
UXP-51792b31a36b9539fdd1b4b85abe486c1652b6c4.tar.xz
UXP-51792b31a36b9539fdd1b4b85abe486c1652b6c4.zip
Revert "Remove unwanted newtab page code"
This reverts commit 277fa0afdc50b707b3227ca327c29766cdcd20f1.
Diffstat (limited to 'application/basilisk/base/content/newtab/page.js')
-rw-r--r--application/basilisk/base/content/newtab/page.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/application/basilisk/base/content/newtab/page.js b/application/basilisk/base/content/newtab/page.js
index b92d3d5ce..f7626ced2 100644
--- a/application/basilisk/base/content/newtab/page.js
+++ b/application/basilisk/base/content/newtab/page.js
@@ -48,6 +48,11 @@ var gPage = {
let enabled = gAllPages.enabled;
this._updateAttributes(enabled);
+ // Update thumbnails to the new enhanced setting
+ if (aData == "browser.newtabpage.enhanced") {
+ this.update();
+ }
+
// Initialize the whole page if we haven't done that, yet.
if (enabled) {
this._init();
@@ -74,7 +79,10 @@ var gPage = {
update(reason = "") {
// Update immediately if we're visible.
if (!document.hidden) {
- if (gGrid.ready) {
+ // Ignore updates where reason=links-changed as those signal that the
+ // provider's set of links changed. We don't want to update visible pages
+ // in that case, it is ok to wait until the user opens the next tab.
+ if (reason != "links-changed" && gGrid.ready) {
gGrid.refresh();
}
@@ -111,6 +119,10 @@ var gPage = {
document.getElementById("newtab-search-submit").value =
document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0";
+ if (Services.prefs.getBoolPref("browser.newtabpage.compact")) {
+ document.body.classList.add("compact");
+ }
+
// Initialize search.
gSearch.init();
@@ -248,6 +260,8 @@ var gPage = {
onPageVisibleAndLoaded() {
// Send the index of the last visible tile.
this.reportLastVisibleTileIndex();
+ // Maybe tell the user they can undo an initial automigration
+ this.maybeShowAutoMigrationUndoNotification();
},
reportLastVisibleTileIndex() {
@@ -273,5 +287,11 @@ var gPage = {
}
}
}
- }
+
+ DirectoryLinksProvider.reportSitesAction(sites, "view", lastIndex);
+ },
+
+ maybeShowAutoMigrationUndoNotification() {
+ sendAsyncMessage("NewTab:MaybeShowAutoMigrationUndoNotification");
+ },
};