Bug 76216 - Too many default columns in the mail/news search results window. Also bug 73549 - Remove dead, commented gThreadTree code in SearchDialog.js r=gayatrib@netscape.com sr=sspitzer@netscape.com

This commit is contained in:
stephend%netscape.com 2001-04-26 23:41:40 +00:00
Родитель 58f3eab2ff
Коммит 219437b55a
1 изменённых файлов: 33 добавлений и 25 удалений

Просмотреть файл

@ -134,9 +134,6 @@ var gSearchNotificationListener =
onNewSearch: function() onNewSearch: function()
{ {
gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForStopButton")); gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForStopButton"));
// if (gThreadTree)
// gThreadTree.clearItemSelection();
document.commandDispatcher.updateCommands('mail-search'); document.commandDispatcher.updateCommands('mail-search');
gStatusFeedback.showProgress(0); gStatusFeedback.showProgress(0);
gStatusFeedback.showStatusString(gSearchBundle.getString("searchingMessage")); gStatusFeedback.showStatusString(gSearchBundle.getString("searchingMessage"));
@ -172,6 +169,24 @@ var gFolderListener = {
} }
} }
function HideSearchColumn(id)
{
var col = document.getElementById(id);
if (col) {
col.setAttribute("hidden","true");
col.setAttribute("ignoreincolumnpicker","true");
}
}
function ShowSearchColumn(id)
{
var col = document.getElementById(id);
if (col) {
col.removeAttribute("hidden");
col.removeAttribute("ignoreincolumnpicker");
}
}
function searchOnLoad() function searchOnLoad()
{ {
initializeSearchWidgets(); initializeSearchWidgets();
@ -188,23 +203,18 @@ function searchOnLoad()
document.commandDispatcher.updateCommands('mail-search'); document.commandDispatcher.updateCommands('mail-search');
moveToAlertPosition(); moveToAlertPosition();
// hide the thread related columns. you can't thread search results // hide and remove these columns from the column picker. you can't thread search results
var threadCol = document.getElementById("threadCol"); HideSearchColumn("threadCol"); // since you can't thread search results
threadCol.setAttribute("hidden","true"); HideSearchColumn("totalCol"); // since you can't thread search results
threadCol.setAttribute("ignoreincolumnpicker","true"); HideSearchColumn("unreadCol"); // since you can't thread search results
HideSearchColumn("unreadButtonColHeader");
HideSearchColumn("statusCol");
HideSearchColumn("sizeCol");
HideSearchColumn("flaggedCol");
HideSearchColumn("totalCol");
var totalCol = document.getElementById("totalCol"); // we want to show the location column for search
totalCol.setAttribute("hidden","true"); ShowSearchColumn("locationCol");
totalCol.setAttribute("ignoreincolumnpicker","true");
var unreadCol = document.getElementById("unreadCol");
unreadCol.setAttribute("hidden","true");
unreadCol.setAttribute("ignoreincolumnpicker","true");
// we want to show this column for search
var locationCol = document.getElementById("locationCol");
locationCol.removeAttribute("hidden");
locationCol.removeAttribute("ignoreincolumnpicker");
} }
function searchOnUnload() function searchOnUnload()
@ -216,8 +226,10 @@ function searchOnUnload()
gMailSession.RemoveFolderListener(gSearchSessionFolderListener); gMailSession.RemoveFolderListener(gSearchSessionFolderListener);
gSearchSession.removeFolderListener(gFolderListener); gSearchSession.removeFolderListener(gFolderListener);
if (gSearchView) {
gSearchView.close(); gSearchView.close();
gSearchView = null; gSearchView = null;
}
// release this early because msgWindow holds a weak reference // release this early because msgWindow holds a weak reference
msgWindow.rootDocShell = null; msgWindow.rootDocShell = null;
@ -226,7 +238,6 @@ function searchOnUnload()
function initializeSearchWindowWidgets() function initializeSearchWindowWidgets()
{ {
gFolderPicker = document.getElementById("searchableFolders"); gFolderPicker = document.getElementById("searchableFolders");
// gThreadTree = document.getElementById("threadTree");
gSearchStopButton = document.getElementById("search-button"); gSearchStopButton = document.getElementById("search-button");
gStatusBar = document.getElementById('statusbar-icon'); gStatusBar = document.getElementById('statusbar-icon');
@ -236,7 +247,6 @@ function initializeSearchWindowWidgets()
// functionality to enable/disable buttons using nsSearchResultsController // functionality to enable/disable buttons using nsSearchResultsController
// depending of whether items are selected in the search results thread pane. // depending of whether items are selected in the search results thread pane.
// gThreadTree.controllers.appendController(nsSearchResultsController);
top.controllers.insertControllerAt(0, nsSearchResultsController); top.controllers.insertControllerAt(0, nsSearchResultsController);
} }
@ -340,8 +350,6 @@ function onSearch()
gSearchSession.search(msgWindow); gSearchSession.search(msgWindow);
// refresh the tree after the search starts, because initiating the // refresh the tree after the search starts, because initiating the
// search will cause the datasource to clear itself // search will cause the datasource to clear itself
// gThreadTree.setAttribute("ref", gThreadTree.getAttribute("ref"));
// dump("Kicking it off with " + gThreadTree.getAttribute("ref") + "\n");
} }
function AddSubFolders(folder) { function AddSubFolders(folder) {