b=451676, r=gavin. Remember the URLBar position when switching tabs

This commit is contained in:
Mark Finkle 2008-08-22 23:25:17 -04:00
Родитель e7758b25dc
Коммит 25094284f6
1 изменённых файлов: 17 добавлений и 0 удалений

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

@ -92,6 +92,20 @@ var BrowserUI = {
this.setURI(); this.setURI();
this._titleChanged(browser.contentDocument); this._titleChanged(browser.contentDocument);
this._favicon.setAttribute("src", browser.mIconURL || kDefaultFavIconURL); this._favicon.setAttribute("src", browser.mIconURL || kDefaultFavIconURL);
let toolbar = document.getElementById("toolbar-main");
let browserBox = document.getElementById("browser");
if (Browser.content.currentTab.chromeTop) {
// Browser box was panned, so let's reset it
browserBox.top = Browser.content.currentTab.chromeTop;
toolbar.top = browserBox.top - toolbar.boxObject.height;
}
else {
// Must be initial conditions
toolbar.top = 0;
browserBox.top = toolbar.boxObject.height;
}
this.show(PANELMODE_NONE); this.show(PANELMODE_NONE);
}, },
@ -196,6 +210,9 @@ var BrowserUI = {
toolbar.top = newTop; toolbar.top = newTop;
browser.top = newTop + toolbar.boxObject.height; browser.top = newTop + toolbar.boxObject.height;
// Cache the current top so we can use it when switching tabs
Browser.content.currentTab.chromeTop = browser.top;
aEvent.stopPropagation(); aEvent.stopPropagation();
} }
} }