mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-12 10:40:12 +00:00
Bug 647841 - Opening a new tab occasionally causes a side panel to appear [r=mfinkle]
This commit is contained in:
parent
270b7c6ac5
commit
d6acfbd33e
@ -661,16 +661,22 @@ var BrowserUI = {
|
||||
// Make sure we're online before attempting to load
|
||||
Util.forceOnline();
|
||||
|
||||
// Give the new page lots of room
|
||||
Browser.hideSidebars();
|
||||
// Close the autocomplete panel and quickly update the urlbar value
|
||||
this.closeAutoComplete();
|
||||
|
||||
this._edit.value = aURI;
|
||||
|
||||
let postData = {};
|
||||
aURI = Browser.getShortcutOrURI(aURI, postData);
|
||||
Browser.loadURI(aURI, { flags: Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP, postData: postData });
|
||||
|
||||
// If a page goes from remote (about:blank) to local (about:home), fennec
|
||||
// create a tab for the local page and then close the about:blank tab.
|
||||
// If the newly created tab spawn a new column the sidebars position can
|
||||
// be messed up. Hopefully, the viewable area should be maximized when a
|
||||
// new page is opened, so a call to Browser.hideSidebars() fill this
|
||||
// requirement and fix the sidebars position.
|
||||
Browser.hideSidebars();
|
||||
|
||||
// Delay doing the fixup so the raw URI is passed to loadURIWithFlags
|
||||
// and the proper third-party fixup can be done
|
||||
let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
|
||||
@ -922,9 +928,14 @@ var BrowserUI = {
|
||||
let { x: x1, y: y1 } = Browser.getScrollboxPosition(Browser.controlsScrollboxScroller);
|
||||
tabs.removeClosedTab();
|
||||
|
||||
let [,, leftWidth, rightWidth] = Browser.computeSidebarVisibility();
|
||||
let delta = (oldLeftWidth - leftWidth) || (oldRightWidth - rightWidth);
|
||||
x1 += (x1 == leftWidth) ? delta : -delta;
|
||||
// If the tabs sidebar lives on the left side of the window, width
|
||||
// variation should be taken into account to reposition the sidebars
|
||||
if (tabs.getBoundingClientRect().left < 0) {
|
||||
let [,, leftWidth, rightWidth] = Browser.computeSidebarVisibility();
|
||||
let delta = (oldLeftWidth - leftWidth) || (oldRightWidth - rightWidth);
|
||||
x1 += (x1 == leftWidth) ? delta : -delta;
|
||||
}
|
||||
|
||||
Browser.controlsScrollboxScroller.scrollTo(x1, 0);
|
||||
Browser.tryFloatToolbar(0, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user