-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/Bug 580252 - Introduce pref gloda.list.immediate to open Glod…
…a result list immediately, take 2, numeric pref. (Issue #169)
- Loading branch information
1 parent
c5aa194
commit b876d89
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# HG changeset patch | ||
# User Betterbird <[email protected]> | ||
# Date 1687990089 -7200 | ||
# Date 1687991707 -7200 | ||
# Parent 2d4670803d7d53cd565135a29a94734a3d10da12 | ||
Bug 580252 - Introduce pref gloda.list.immediate to open Gloda result list immediately. | ||
|
||
diff --git a/mail/app/profile/all-thunderbird.js b/mail/app/profile/all-thunderbird.js | ||
--- a/mail/app/profile/all-thunderbird.js | ||
+++ b/mail/app/profile/all-thunderbird.js | ||
@@ -631,16 +631,17 @@ pref("media.autoplay.enabled", false); | ||
@@ -631,16 +631,20 @@ pref("media.autoplay.enabled", false); | ||
pref("gloda.facetview.hidetimeline", true); | ||
|
||
// Behavior of sort-by setting in search results: | ||
|
@@ -16,7 +16,10 @@ diff --git a/mail/app/profile/all-thunderbird.js b/mail/app/profile/all-thunderb | |
// 2 - default to "relevance", but remember user preference when it is changed | ||
// 3 - default to "date", but remember user preference when it is changed | ||
pref("gloda.facetview.sortby", 2); | ||
+pref("gloda.list.immediate", false); | ||
+// 0 - Open facet view | ||
+// 1 - Open facet view and list view | ||
+// 2 - Open list view only (closing facet view) | ||
+pref("gloda.list.immediate", 0); | ||
|
||
// Enable gloda by default! | ||
pref("mailnews.database.global.indexer.enabled", true); | ||
|
@@ -28,7 +31,7 @@ diff --git a/mail/app/profile/all-thunderbird.js b/mail/app/profile/all-thunderb | |
diff --git a/mail/base/content/glodaFacetTab.js b/mail/base/content/glodaFacetTab.js | ||
--- a/mail/base/content/glodaFacetTab.js | ||
+++ b/mail/base/content/glodaFacetTab.js | ||
@@ -82,16 +82,25 @@ var glodaFacetTabType = { | ||
@@ -82,16 +82,30 @@ var glodaFacetTabType = { | ||
"chrome://messenger/content/glodaFacetView.xhtml" | ||
); | ||
|
||
|
@@ -37,13 +40,18 @@ diff --git a/mail/base/content/glodaFacetTab.js b/mail/base/content/glodaFacetTa | |
searchInput.focus(); | ||
} | ||
|
||
+ if (Services.prefs.getBoolPref("gloda.list.immediate", false)) { | ||
+ let listImmediate = Services.prefs.getIntPref("gloda.list.immediate", 0); | ||
+ if (listImmediate) { | ||
+ aTab.iframe.contentWindow.addEventListener("DOMContentLoaded", async () => { | ||
+ let win = aTab.iframe.contentDocument.getElementById("browser").contentWindow; | ||
+ while (!win.FacetContext) { | ||
+ await new Promise(r => top.window.setTimeout(r, 100)); | ||
+ } | ||
+ win.FacetContext.showActiveSetInTab(); | ||
+ if (listImmediate == 2) { | ||
+ let tabmail = top.window.document.getElementById("tabmail"); | ||
+ tabmail.closeTab(aTab); | ||
+ } | ||
+ }, { once: true }); | ||
+ } | ||
aTab.iframe.contentWindow.addEventListener("load", xulLoadHandler, { | ||
|