Comment 76 for bug 572074

Revision history for this message
In , Gijskruitbosch+bugs (gijskruitbosch+bugs) wrote :

(In reply to Dão Gottwald [:dao] from comment #69)
> Comment on attachment 8781962
> middlemouse on new tab button should create a new tab related to current,
>
> > function BrowserOpenNewTabOrWindow(event) {
> >- if (event.shiftKey) {
> >+ let where = whereToOpenLink(event);
> >+ if (where == "window") {
> > OpenBrowserWindow();
> > } else {
> >- BrowserOpenTab();
> >+ // Make new tab related to current except when created via a shortcut <key> command.
>
> This comment doesn't seem accurate, e.g. we don't want to open the tab
> related to the current one for plain clicks... right?
>
> >+ let sourceNotKeyEvent = !event.sourceEvent || event.sourceEvent.target.localName != "key";
> >+ let relatedToCurrent = (where == "tab" || where == "tabshifted") && sourceNotKeyEvent;
> >+ openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {relatedToCurrent,
> >+ inBackground: where == "tabshifted"});
>
> I'm somewhat confused by this. Why are you not passing through "tabshifted"
> as openUILinkIn's 'where' argument?

I literally just used the suggestion you gave in comment #65. I can't just pass "tab" because in some cases where == "current". I'll rewrite to use a ternary and drop the inBackground prop, I guess? I'm fairly sure there will be no behavioural difference compared to the current patch.