diff options
| author | mrmr1993 | 2014-04-16 18:12:09 +0100 |
|---|---|---|
| committer | mrmr1993 | 2016-01-30 11:40:43 +0000 |
| commit | 7f3ae1ffcf3185392cf30a62f4b83474b68f66cc (patch) | |
| tree | 94109be8693e323b9c0c2efa31122cc884ffcbdb | |
| parent | c3373252db73430ec466eb0b81a16a5953975e19 (diff) | |
| download | vimium-7f3ae1ffcf3185392cf30a62f4b83474b68f66cc.tar.bz2 | |
Add number modifier to `gg' scrollToTop command
| -rw-r--r-- | background_scripts/commands.coffee | 2 | ||||
| -rw-r--r-- | 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") |
