From c21aa9ab03d5537d575d3c46d3affce7f3ece5e5 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 13 Jun 2015 12:55:01 +0100 Subject: Refactor findInPlace. This code belongs together, so we put it together. --- content_scripts/hud.coffee | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'content_scripts/hud.coffee') diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index cd34efe8..2f4e008c 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -33,9 +33,7 @@ HUD = @tween.fade 1.0, 150 search: (data) -> - window.scrollTo @findMode.scrollX, @findMode.scrollY if @findMode.options.returnToViewport - FindMode.updateQuery data.query - @findMode.findInPlace() + @findMode.findInPlace data.query # Show the number of matches in the HUD UI. matchCount = if FindMode.query.parsedQuery.length > 0 then FindMode.query.matchCount else 0 -- cgit v1.2.3 From 4f426affde34c895cf342dac256895ffe98ee4f3 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 13 Jun 2015 13:03:10 +0100 Subject: Refactor duplicate code. --- content_scripts/hud.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'content_scripts/hud.coffee') diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index 2f4e008c..bfad71b7 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -57,7 +57,7 @@ HUD = @tween.fade 0, 150, => @hide true, updateIndicator hideFindMode: (data) -> - window.scrollTo @findMode.scrollX, @findMode.scrollY if @findMode.options.returnToViewport + @findMode.checkReturnToViewPort() # An element element won't receive a focus event if the search landed on it while we were in the HUD # iframe. To end up with the correct modes active, we create a focus/blur event manually after refocusing -- cgit v1.2.3