mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 04:07:58 +01:00
added many folding commands to muttator
This commit is contained in:
@@ -186,6 +186,10 @@ liberator.Mail = function ()
|
|||||||
{ flags: liberator.Mappings.flags.COUNT });
|
{ flags: liberator.Mappings.flags.COUNT });
|
||||||
|
|
||||||
|
|
||||||
|
liberator.mappings.add(modes, ["za"],
|
||||||
|
"Toggle thread collapsed/expanded",
|
||||||
|
function () { if (!liberator.mail.expandThread()) liberator.mail.collapseThread(); });
|
||||||
|
|
||||||
liberator.mappings.add(modes, ["zc"],
|
liberator.mappings.add(modes, ["zc"],
|
||||||
"Collapse thread",
|
"Collapse thread",
|
||||||
function () { liberator.mail.collapseThread(); });
|
function () { liberator.mail.collapseThread(); });
|
||||||
@@ -194,6 +198,14 @@ liberator.Mail = function ()
|
|||||||
"Open thread",
|
"Open thread",
|
||||||
function () { liberator.mail.expandThread(); });
|
function () { liberator.mail.expandThread(); });
|
||||||
|
|
||||||
|
liberator.mappings.add(modes, ["zr", "zR"],
|
||||||
|
"Expand all threads",
|
||||||
|
function () { goDoCommand("cmd_expandAllThreads"); });
|
||||||
|
|
||||||
|
liberator.mappings.add(modes, ["zm", "zM"],
|
||||||
|
"Collapse all threads",
|
||||||
|
function () { goDoCommand("cmd_collapseAllThreads"); });
|
||||||
|
|
||||||
|
|
||||||
liberator.mappings.add(modes, ["<C-i>"],
|
liberator.mappings.add(modes, ["<C-i>"],
|
||||||
"Get new messages",
|
"Get new messages",
|
||||||
@@ -369,40 +381,39 @@ liberator.Mail = function ()
|
|||||||
|
|
||||||
collapseThread: function()
|
collapseThread: function()
|
||||||
{
|
{
|
||||||
//var tree = document.getElementById('folderTree');
|
|
||||||
var tree = GetThreadTree();
|
var tree = GetThreadTree();
|
||||||
if (tree)
|
if (tree)
|
||||||
{
|
{
|
||||||
if (!tree.changeOpenState(tree.currentIndex, false))
|
var parent = tree.currentIndex;
|
||||||
|
while (true)
|
||||||
{
|
{
|
||||||
var parentIndex = tree.view.getParentIndex(tree.currentIndex);
|
var tmp = tree.view.getParentIndex(parent);
|
||||||
if (parentIndex >= 0)
|
if (tmp >= 0)
|
||||||
{
|
parent = tmp;
|
||||||
tree.view.selection.select(parentIndex);
|
else
|
||||||
tree.treeBoxObject.ensureRowIsVisible(parentIndex);
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tree.changeOpenState(parent, false))
|
||||||
|
{
|
||||||
|
tree.view.selection.select(parent);
|
||||||
|
tree.treeBoxObject.ensureRowIsVisible(parent);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
expandThread: function()
|
expandThread: function()
|
||||||
{
|
{
|
||||||
//var tree = document.getElementById('folderTree');
|
|
||||||
|
|
||||||
var tree = GetThreadTree();
|
var tree = GetThreadTree();
|
||||||
if (tree)
|
if (tree)
|
||||||
{
|
{
|
||||||
var row = tree.currentIndex;
|
var row = tree.currentIndex;
|
||||||
if (row >= 0 && !tree.changeOpenState(row, true))
|
if (row >= 0 && tree.changeOpenState(row, true))
|
||||||
{
|
return true;
|
||||||
var view = tree.view;
|
|
||||||
if (row + 1 < view.rowCount && view.getParentIndex(row + 1) == row)
|
|
||||||
{
|
|
||||||
tree.view.selection.timedSelect(row + 1, tree._selectDelay);
|
|
||||||
tree.treeBoxObject.ensureRowIsVisible(row + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
selectMessage: function(validatorFunc, canWrap, reverse, count)
|
selectMessage: function(validatorFunc, canWrap, reverse, count)
|
||||||
|
|||||||
Reference in New Issue
Block a user