Skip to content

Commit

Permalink
Bug 1483786 - Add aOptions object param to 'replaceTabsWithWindow' fu…
Browse files Browse the repository at this point in the history
…nction in browser/base/content/tabbrowser.js file. r=jaws

replaceTabsWithWindow calls replaceTabWithWindow to create a new window window with a first tab.
But unlike the later function, the former cited function don't take an object param (aOptions) containing informations such as the mouse position (which helps set the new window position).
To adress the issue, we added support for passing an option param to replaceTabsWithWindow which just transferts the param to replaceTabWithWindow.

Differential Revision: https://phabricator.services.mozilla.com/D4735

--HG--
extra : moz-landing-system : lando
  • Loading branch information
layely committed Aug 31, 2018
1 parent 7a2169b commit c72e455
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/base/content/tabbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3502,7 +3502,7 @@ window._gBrowser = {
* to a new browser window, unless it is (they are) already the only tab(s)
* in the current window, in which case this will do nothing.
*/
replaceTabsWithWindow(contextTab) {
replaceTabsWithWindow(contextTab, aOptions) {
let tabs;
if (contextTab.multiselected) {
tabs = this.selectedTabs;
Expand All @@ -3515,7 +3515,7 @@ window._gBrowser = {
}

if (tabs.length == 1) {
return this.replaceTabWithWindow(tabs[0]);
return this.replaceTabWithWindow(tabs[0], aOptions);
}

// The order of the tabs is reserved.
Expand Down Expand Up @@ -3553,7 +3553,7 @@ window._gBrowser = {
winVisibleTabs[winTabLength - 1]);
}, { once: true });

win = this.replaceTabWithWindow(firstInactiveTab);
win = this.replaceTabWithWindow(firstInactiveTab, aOptions);
return win;
},

Expand Down

0 comments on commit c72e455

Please sign in to comment.