Bug 518545: middle click on scrollbar opens selected message in a new tab; r=Neil

This commit is contained in:
Karsten Düsterloh 2010-12-14 23:31:18 +01:00
Родитель 8129d53f8e
Коммит fafdb82d0a
2 изменённых файлов: 12 добавлений и 7 удалений

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

@ -1217,6 +1217,10 @@ function GetSelectedFolderIndex()
// It will also keep the outline/dotted line in the original row.
function ChangeSelectionWithoutContentLoad(event, tree)
{
// usually, we're only interested in tree content clicks, not scrollbars etc.
if (event.originalTarget.localName != "treechildren")
return;
var treeBoxObj = tree.treeBoxObject;
var treeSelection = tree.view.selection;
@ -1255,6 +1259,10 @@ function TreeOnMouseDown(event)
function FolderPaneOnClick(event)
{
// usually, we're only interested in tree content clicks, not scrollbars etc.
if (event.originalTarget.localName != "treechildren")
return;
// we may want to open the folder in a new tab on middle click
if (event.button == kMouseButtonMiddle)
{
@ -1281,11 +1289,6 @@ function FolderPaneOnClick(event)
event.stopPropagation();
}
}
else if ((event.originalTarget.localName == "slider") ||
(event.originalTarget.localName == "scrollbarbutton"))
{
event.stopPropagation();
}
else if ((event.detail == 2) &&
(elt.value != "twisty") &&
(folderTree.view.getLevel(row.value) != 0))

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

@ -42,10 +42,13 @@ var gThreadPaneCommandUpdater = null;
function ThreadPaneOnClick(event)
{
// usually, we're only interested in tree content clicks, not scrollbars etc.
let t = event.originalTarget;
// we may want to open the message in a new tab on middle click
if (event.button == kMouseButtonMiddle)
{
if (AllowOpenTabOnMiddleClick())
if (t.localName == "treechildren" && AllowOpenTabOnMiddleClick())
{
// we don't allow new tabs in the search dialog
if ("RestoreSelectionWithoutContentLoad" in window)
@ -66,7 +69,6 @@ function ThreadPaneOnClick(event)
// We also get in here for clicks on the "treecol" (headers) and the
// "scrollbarbutton" (scrollbar buttons), but we don't want those events to
// cause a "double click".
var t = event.originalTarget;
if (t.localName == "treecol")
{
HandleColumnClick(t.id);