Make Lightning dynamically adapt to new Thunderbird searchbox UI (bug 325140), thanks to Joey Minta <jminta@gmail.com> for the patch, r=<dmose@mozilla.org>.

This commit is contained in:
dmose%mozilla.org 2006-01-31 05:59:11 +00:00
Родитель 7afd97edec
Коммит 4c20842e64
1 изменённых файлов: 26 добавлений и 2 удалений

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

@ -110,7 +110,10 @@ function showCalendarView(type)
if (calendarViewBox.style.visibility == "collapse") { if (calendarViewBox.style.visibility == "collapse") {
collapseElement(GetMessagePane()); collapseElement(GetMessagePane());
collapseElement(document.getElementById("threadpane-splitter")); collapseElement(document.getElementById("threadpane-splitter"));
collapseElement(gSearchBox); var searchBox = findMailSearchBox();
if (searchBox) {
collapseElement(searchBox);
}
uncollapseElement(calendarViewBox); uncollapseElement(calendarViewBox);
// Thunderbird is smart. It won't reload the message list if the user // Thunderbird is smart. It won't reload the message list if the user
@ -193,7 +196,10 @@ function LtnObserveDisplayDeckChange(event)
collapseElement(document.getElementById("calendar-view-box")); collapseElement(document.getElementById("calendar-view-box"));
uncollapseElement(GetMessagePane()); uncollapseElement(GetMessagePane());
uncollapseElement(document.getElementById("threadpane-splitter")); uncollapseElement(document.getElementById("threadpane-splitter"));
uncollapseElement(gSearchBox); var searchBox = findMailSearchBox();
if (searchBox) {
uncollapseElement(searchBox);
}
} }
} }
@ -237,6 +243,24 @@ function onMouseOverItem(event) {
//set the item's context-menu text here //set the item's context-menu text here
} }
// After 1.5 was released, the search box was moved into an optional toolbar
// item, with a different ID. This function keeps us compatible with both.
function findMailSearchBox() {
var tb15Box = document.getElementById("searchBox");
if (tb15Box) {
return tb15Box;
}
var tb2Box = document.getElementById("searchInput");
if (tb2Box) {
return tb2Box;
}
// In later versions, it's possible that a user removed the search box from
// the toolbar.
return null;
}
document.getElementById("displayDeck"). document.getElementById("displayDeck").
addEventListener("select", LtnObserveDisplayDeckChange, true); addEventListener("select", LtnObserveDisplayDeckChange, true);