1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-29 08:55:46 +01:00

Prefer Math.max when normalising counts in commands.

This commit is contained in:
Doug Kearns
2009-06-14 00:53:57 +10:00
parent 30a54a4271
commit 5ebcdb71bc

View File

@@ -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)
{