From eab32403cd14b973eeeac5fb7be05759d906740e Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Mon, 30 Mar 2009 17:21:42 +0300 Subject: [PATCH] UI tweak when maxitems 7 (Jarkko Oranen) --- common/content/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index 05ebe89e..8aeaa838 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -780,7 +780,7 @@ function CommandLine() //{{{ options.add(["maxitems"], "Maximum number of items to display at once", "number", 20, - { validator: function (value) value >= 0 }); + { validator: function (value) value >= 1 }); options.add(["messages", "msgs"], "Number of messages to store in the message history", @@ -1950,7 +1950,7 @@ function ItemList(id) //{{{ let len = items.allItems.items.length; let newOffset = startIndex; let maxItems = options["maxitems"]; - let contextLines = (maxItems > 3)? 3 : Math.max(0, maxItems - 1); + let contextLines = Math.min(3, parseInt((maxItems - 1) / 2)); if (index == -1 || index == null || index == len) // wrapped around {