From 457a976421107f9a67ac43090b0370366427bce1 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 3 Jun 2015 19:13:17 +0100 Subject: Add mark commands to README, more simple refactoring. --- content_scripts/marks.coffee | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/marks.coffee b/content_scripts/marks.coffee index 73c019da..971feadf 100644 --- a/content_scripts/marks.coffee +++ b/content_scripts/marks.coffee @@ -54,16 +54,15 @@ Marks = indicator: "Go to mark..." suppressAllKeyboardEvents: true keypress: (event) => - keyChar = String.fromCharCode event.charCode - if event.shiftKey - @exit -> + @exit => + keyChar = String.fromCharCode event.charCode + if event.shiftKey chrome.runtime.sendMessage handler: 'gotoMark' markName: keyChar - else - markString = - if keyChar == previousPositionKey then @previousPosition else localStorage[@getLocationKey keyChar] - @exit => + else + markString = + if keyChar == previousPositionKey then @previousPosition else localStorage[@getLocationKey keyChar] if markString? @setPreviousPosition() position = JSON.parse markString -- cgit v1.2.3