aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2018-06-18 10:10:09 +0100
committerGitHub2018-06-18 10:10:09 +0100
commit16f9249c9d0fb10a3930ee5a52b423fc2d5396a3 (patch)
tree754518c68da2441513a95c322333f6045738768a
parent5745bb344959a61297fc16e00bb6de0a2a8744d9 (diff)
parent4cf37b5c5e9ba7b8e4b4c72a960761624d8151e8 (diff)
downloadvimium-16f9249c9d0fb10a3930ee5a52b423fc2d5396a3.tar.bz2
Merge pull request #3044 from smblott-github/local-marks-using-hash
Use hash (too) for local marks.
-rw-r--r--content_scripts/marks.coffee7
1 files changed, 5 insertions, 2 deletions
diff --git a/content_scripts/marks.coffee b/content_scripts/marks.coffee
index fb1d1b1d..3690908d 100644
--- a/content_scripts/marks.coffee
+++ b/content_scripts/marks.coffee
@@ -15,7 +15,7 @@ Marks =
"vimiumMark|#{window.location.href.split('#')[0]}|#{keyChar}"
getMarkString: ->
- JSON.stringify scrollX: window.scrollX, scrollY: window.scrollY
+ JSON.stringify scrollX: window.scrollX, scrollY: window.scrollY, hash: window.location.hash
setPreviousPosition: ->
markString = @getMarkString()
@@ -84,7 +84,10 @@ Marks =
if markString?
@setPreviousPosition()
position = JSON.parse markString
- window.scrollTo position.scrollX, position.scrollY
+ if position.hash and position.scrollX == 0 and position.scrollY == 0
+ window.location.hash = position.hash
+ else
+ window.scrollTo position.scrollX, position.scrollY
@showMessage "Jumped to local mark", keyChar
else
@showMessage "Local mark not set", keyChar