From 7f3ae1ffcf3185392cf30a62f4b83474b68f66cc Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 16 Apr 2014 18:12:09 +0100 Subject: Add number modifier to `gg' scrollToTop command --- background_scripts/commands.coffee | 2 +- content_scripts/vimium_frontend.coffee | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index c8121a96..6f7b4334 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -258,7 +258,7 @@ commandDescriptions = scrollLeft: ["Scroll left"] scrollRight: ["Scroll right"] - scrollToTop: ["Scroll to the top of the page", { noRepeat: true }] + scrollToTop: ["Scroll to the top of the page", { passCountToFunction: true }] scrollToBottom: ["Scroll to the bottom of the page", { noRepeat: true }] scrollToLeft: ["Scroll all the way to the left", { noRepeat: true }] scrollToRight: ["Scroll all the way to the right", { noRepeat: true }] diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 781223b1..f74e8480 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -308,10 +308,9 @@ window.focusThisFrame = -> extend window, scrollToBottom: -> Marks.setPreviousPosition() - Scroller.scrollTo "y", "max" - scrollToTop: -> + scrollToTop: (count) -> Marks.setPreviousPosition() - Scroller.scrollTo "y", 0 + Scroller.scrollTo "y", (count - 1) * Settings.get("scrollStepSize") scrollToLeft: -> Scroller.scrollTo "x", 0 scrollToRight: -> Scroller.scrollTo "x", "max" scrollUp: -> Scroller.scrollBy "y", -1 * Settings.get("scrollStepSize") -- cgit v1.2.3 From d0371a08fd667c31d2681473a8c4e6c8eca4b6ef Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 31 Jan 2016 14:25:39 +0000 Subject: Fix oversight in 7f3ae1ffcf3185392cf30a62f4b83474b68f66cc. One line was unintentionally deleted. --- content_scripts/vimium_frontend.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index f74e8480..a4df78b2 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -308,6 +308,7 @@ window.focusThisFrame = -> extend window, scrollToBottom: -> Marks.setPreviousPosition() + Scroller.scrollTo "y", "max" scrollToTop: (count) -> Marks.setPreviousPosition() Scroller.scrollTo "y", (count - 1) * Settings.get("scrollStepSize") -- cgit v1.2.3