From 35d0c3fc676ea9ec332ef48566993307859ea12e 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) git-svn-id: svn://10.0.0.236/trunk@134189 18797224-902f-48f8-a5cc-f745e15eee43 --- .../resources/content/mailWindowOverlay.js | 20 +++++++++++++++---- .../resources/content/mailWindowOverlay.xul | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js b/mozilla/mailnews/base/resources/content/mailWindowOverlay.js index 97847615338..f55292de9ac 100644 --- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js +++ b/mozilla/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/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul index 1f906790f5e..5b320dd5719 100644 --- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul @@ -275,7 +275,7 @@ Rights Reserved. - +