From de9a8edc7877bf4591328591e2dcabc59d7967e3 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 31 Jul 2002 21:50:36 +0000 Subject: [PATCH] update extra toolbar. I think there might be a bug in the command updating suppression code here. git-svn-id: svn://10.0.0.236/branches/ANYTHING_FOR_PUTTERMAN_BRANCH@126130 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/resources/content/commandglue.js | 5 +++++ .../mailnews/base/resources/content/msgMail3PaneWindow.js | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mozilla/mailnews/base/resources/content/commandglue.js b/mozilla/mailnews/base/resources/content/commandglue.js index 8f3d60ac283..c0ae68d1040 100644 --- a/mozilla/mailnews/base/resources/content/commandglue.js +++ b/mozilla/mailnews/base/resources/content/commandglue.js @@ -318,7 +318,12 @@ function RerootFolder(uri, newFolder, viewType, viewFlags, sortType, sortOrder) } SetUpToolbarButtons(uri); + UpdateStatusMessageCounts(newFolder); + + // hook for extra toolbar items + var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); + observerService.notifyObservers(window, "mail:updateToolbarItems", null); } function SwitchView(command) diff --git a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js index b757c65551a..a1d19778825 100644 --- a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -350,9 +350,15 @@ function HandleDeleteOrMoveMsgCompleted(folder) if (treeView) treeView.selectionChanged(); - EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; + + // hook for extra toolbar items + // XXX I think there is a bug in the suppression code above. + // what if I have two rows selected, and I hit delete, and so we load the next row. + // what if I have commands that only enable where exactly one row is selected? + var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); + observerService.notifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2;