From ea72d89df19cb0018b512442d9c40f7c71d8fe35 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Wed, 13 Sep 2006 00:09:12 +0000 Subject: [PATCH] Bug #351959 --> stand alone message window has a quick search box in it. The customize toolbar dialog for stand alone msg window shows quick search, mail views and folder location toolbar buttons. sr=bienvenu --- mail/base/content/messageWindow.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mail/base/content/messageWindow.js b/mail/base/content/messageWindow.js index c6cc5ef1313e..49b56681ec7c 100644 --- a/mail/base/content/messageWindow.js +++ b/mail/base/content/messageWindow.js @@ -434,14 +434,27 @@ function ShowMenus() // Toolbar buttons like quick search and mail views should be hidden for the message window function HideToolbarButtons() { - // How can we remove these two items from the palette as well? var mailToolbar = document.getElementById('mail-bar2'); if (mailToolbar) { + // the quick search box is part of the default toolbar set for the 3-pane and since it is shared code, + // the stand alone message window. We need to remove the search-container from the defaultset, + // remove the toolbar button itself from the DOM because we've already created it. var defaultSet = mailToolbar.getAttribute("defaultset"); defaultSet = defaultSet.replace(/search-container/i, ""); - defaultSet = defaultSet.replace(/mailviews-container/i, ""); mailToolbar.setAttribute('defaultset', defaultSet); + + var searchContainer = document.getElementById('search-container'); + if (searchContainer) + searchContainer.parentNode.removeChild(searchContainer); + + // now hack the toolbar palette to remove all of the toolbar items which don't + // make sense for the stand alone message window. This prevents them from showing up in the + // customize dialog. + var toolbarPalette = document.getElementById('mail-toolbox').palette; + toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'search-container')[0]); + toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'mailviews-container')[0]); + toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'folder-location-container')[0]); } }