Skip to content

Commit

Permalink
Feature/Bug 580252 - Introduce pref gloda.list.immediate to open Glod…
Browse files Browse the repository at this point in the history
…a result list immediately, take 3, no endless loop. (Issue #169)
  • Loading branch information
Betterbird committed Jun 29, 2023
1 parent 3aaf92c commit 45d2b8e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HG changeset patch
# User Betterbird <[email protected]>
# Date 1687991707 -7200
# Date 1688025052 -7200
# Parent 2d4670803d7d53cd565135a29a94734a3d10da12
Bug 580252 - Introduce pref gloda.list.immediate to open Gloda result list immediately.

Expand Down Expand Up @@ -31,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,30 @@ var glodaFacetTabType = {
@@ -82,16 +82,31 @@ var glodaFacetTabType = {
"chrome://messenger/content/glodaFacetView.xhtml"
);

Expand All @@ -41,14 +41,15 @@ diff --git a/mail/base/content/glodaFacetTab.js b/mail/base/content/glodaFacetTa
}

+ let listImmediate = Services.prefs.getIntPref("gloda.list.immediate", 0);
+ if (listImmediate) {
+ if (listImmediate > 0) {
+ aTab.iframe.contentWindow.addEventListener("DOMContentLoaded", async () => {
+ let win = aTab.iframe.contentDocument.getElementById("browser").contentWindow;
+ while (!win.FacetContext) {
+ let count = 0;
+ while (count++ < 20 && !win.FacetContext) {
+ await new Promise(r => top.window.setTimeout(r, 100));
+ }
+ win.FacetContext.showActiveSetInTab();
+ if (listImmediate == 2) {
+ if (listImmediate > 1) {
+ let tabmail = top.window.document.getElementById("tabmail");
+ tabmail.closeTab(aTab);
+ }
Expand Down

0 comments on commit 45d2b8e

Please sign in to comment.