From 64e17d2014324685728eafde5a44a85087f45584 Mon Sep 17 00:00:00 2001 From: "shliang%netscape.com" Date: Tue, 6 May 2003 01:04:17 +0000 Subject: [PATCH] 195285 - junk mail column placement incorrect for existing profiles. r=jag,sr/a=sspitzer. --- .../resources/content/msgMail3PaneWindow.js | 23 +++++++++++++++---- mailnews/mailnews.js | 3 ++- modules/libpref/src/init/mailnews.js | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mailnews/base/resources/content/msgMail3PaneWindow.js b/mailnews/base/resources/content/msgMail3PaneWindow.js index 104b6dbc85b..bcfd26efd9a 100644 --- a/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -922,11 +922,24 @@ function UpgradeThreadPaneUI() try { threadPaneUIVersion = pref.getIntPref("mailnews.ui.threadpane.version"); - if (threadPaneUIVersion == 1) { - labelCol = document.getElementById("labelCol"); - labelCol.setAttribute("hidden", "true"); - pref.setIntPref("mailnews.ui.threadpane.version", 2); - } + if (threadPaneUIVersion < 3) { + var subjectCol = document.getElementById("subjectCol"); + var junkCol = document.getElementById("junkStatusCol"); + var threadTree = document.getElementById("threadTree"); + + var beforeCol = subjectCol.boxObject.nextSibling.boxObject.nextSibling; + if (beforeCol) + threadTree._reorderColumn(junkCol, beforeCol, true); + else // subjectCol was the last column, put it after + threadTree._reorderColumn(junkCol, subjectCol, false); + + if (threadPaneUIVersion == 1) { + labelCol = document.getElementById("labelCol"); + labelCol.setAttribute("hidden", "true"); + } + + pref.setIntPref("mailnews.ui.threadpane.version", 3); + } } catch (ex) { dump("UpgradeThreadPane: ex = " + ex + "\n"); diff --git a/mailnews/mailnews.js b/mailnews/mailnews.js index c38863f2886..39d95ad84a7 100644 --- a/mailnews/mailnews.js +++ b/mailnews/mailnews.js @@ -450,7 +450,8 @@ pref("mail.ui.folderpane.version", 1); // for manual upgrades of certain UI features. // 1 -> 2 is for the thread pane tree landing, to hide the // labels column, see msgMail3PaneWindow.js -pref("mailnews.ui.threadpane.version", 1); +// 2 -> 3 is for the junk status column +pref("mailnews.ui.threadpane.version", 1); // for manual upgrades of certain UI features. // 1 -> 2 is for the ab results pane tree landing // to hide the non default columns in the addressbook dialog diff --git a/modules/libpref/src/init/mailnews.js b/modules/libpref/src/init/mailnews.js index c38863f2886..39d95ad84a7 100644 --- a/modules/libpref/src/init/mailnews.js +++ b/modules/libpref/src/init/mailnews.js @@ -450,7 +450,8 @@ pref("mail.ui.folderpane.version", 1); // for manual upgrades of certain UI features. // 1 -> 2 is for the thread pane tree landing, to hide the // labels column, see msgMail3PaneWindow.js -pref("mailnews.ui.threadpane.version", 1); +// 2 -> 3 is for the junk status column +pref("mailnews.ui.threadpane.version", 1); // for manual upgrades of certain UI features. // 1 -> 2 is for the ab results pane tree landing // to hide the non default columns in the addressbook dialog