mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-10-17 00:42:32 +02:00
Prefer Math.max when normalising counts in commands.
This commit is contained in:
1 parent
30a54a4271
commit
5ebcdb71bc
1 file changed
+3
-3
@@ -147,7 +147,7 @@ function Mail() //{{{
|
||||
// does not wrap yet, intentional?
|
||||
function selectUnreadFolder(backwards, count)
|
||||
{
|
||||
count = (count > 0 ) ? count : 1;
|
||||
count = Math.max(1, count);
|
||||
let direction = backwards ? -1 : 1;
|
||||
let c = getCurrentFolderIndex();
|
||||
let i = direction;
|
||||
@@ -462,7 +462,7 @@ function Mail() //{{{
|
||||
"Select next folder",
|
||||
function (count)
|
||||
{
|
||||
count = (count > 0 ) ? count : 1;
|
||||
count = Math.max(1, count);
|
||||
let newPos = getCurrentFolderIndex() + count;
|
||||
if (newPos >= gFolderTreeView.rowCount)
|
||||
{
|
||||
@@ -485,7 +485,7 @@ function Mail() //{{{
|
||||
"Select previous folder",
|
||||
function (count)
|
||||
{
|
||||
count = (count > 0 ) ? count : 1;
|
||||
count = Math.max(1, count);
|
||||
let newPos = getCurrentFolderIndex() - count;
|
||||
if (newPos < 0)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user