From 137d7ccf5dea6db00b8297d3268fb14accab5538 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 20 Nov 2002 11:49:10 +0000 Subject: [PATCH] fix for #180131. shift space should scroll upwards, and at the beginning, go to the previous unread. (space alone goes down, and at the end, to the next unread.) thanks to neil@parkwaycc.co.uk for logging the RFE and providing the initial patch. (I believe pine and Mail.app do this, much to the delight of their users) --- .../resources/content/mailWindowOverlay.js | 20 +++++++++++++++---- .../resources/content/mailWindowOverlay.xul | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mailnews/base/resources/content/mailWindowOverlay.js b/mailnews/base/resources/content/mailWindowOverlay.js index 97847615338a..f55292de9acd 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.js +++ b/mailnews/base/resources/content/mailWindowOverlay.js @@ -1625,16 +1625,28 @@ function MsgGoForward() {} function MsgAddSenderToAddressBook() {} function MsgAddAllToAddressBook() {} -function SpaceHit() +function SpaceHit(event) { var contentWindow = window.top._content; var oldScrollY = contentWindow.scrollY; - contentWindow.scrollByPages(1); + var numPages; + var command; - // if at the end of the message, go to the next one + if (event && event.shiftKey) { + numPages = -1; + command = "cmd_previousUnreadMsg"; + } + else { + numPages = 1; + command = "cmd_nextUnreadMsg"; + } + + contentWindow.scrollByPages(numPages); + + // if at the end (or start) of the message, go to the next one if (oldScrollY == contentWindow.scrollY) { - goDoCommand('cmd_nextUnreadMsg'); + goDoCommand(command); } } diff --git a/mailnews/base/resources/content/mailWindowOverlay.xul b/mailnews/base/resources/content/mailWindowOverlay.xul index 1f906790f5ef..5b320dd57198 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mailnews/base/resources/content/mailWindowOverlay.xul @@ -275,7 +275,7 @@ Rights Reserved. - +