aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode_find.coffee
diff options
context:
space:
mode:
authormrmr19932017-04-16 16:07:22 +0100
committermrmr19932017-04-16 16:07:22 +0100
commit1df58a31b95705b2ea065c11af80fb2a667be1ec (patch)
tree0c1587be2c6e019f0555af3a215d24e23809677e /content_scripts/mode_find.coffee
parent8b37743fa6f924995bb5fce581c4c73ad886257d (diff)
downloadvimium-1df58a31b95705b2ea065c11af80fb2a667be1ec.tar.bz2
Rework FindMode HUD refocusing to not depend directly on the HUD
Diffstat (limited to 'content_scripts/mode_find.coffee')
-rw-r--r--content_scripts/mode_find.coffee8
1 files changed, 3 insertions, 5 deletions
diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee
index 73b3a77a..d6835e6b 100644
--- a/content_scripts/mode_find.coffee
+++ b/content_scripts/mode_find.coffee
@@ -87,7 +87,7 @@ class FindMode extends Mode
selection.removeAllRanges()
selection.addRange range
- findInPlace: (query) ->
+ findInPlace: (query, options) ->
# If requested, restore the scroll position (so that failed searches leave the scroll position unchanged).
@checkReturnToViewPort()
FindMode.updateQuery query
@@ -95,7 +95,7 @@ class FindMode extends Mode
# match as the user adds matching characters, or removes previously-matched characters. See #1434.
@restoreSelection()
query = if FindMode.query.isRegex then FindMode.getNextQueryFromRegexMatches(0) else FindMode.query.parsedQuery
- FindMode.query.hasResults = FindMode.execute query
+ FindMode.query.hasResults = FindMode.execute query, options
@updateQuery: (query) ->
@query.rawQuery = query
@@ -181,9 +181,7 @@ class FindMode extends Mode
try
result = window.find(query, options.caseSensitive, options.backwards, true, false, true, false)
catch # Failed searches throw on Firefox.
- # NOTE(mrmr1993): On Firefox, window.find moves the window focus away from the HUD. We put it back, so
- # the user can continue typing.
- try HUD.hudUI.iframeElement.contentWindow.focus()
+ options.postFindFocus?.focus()
if options.colorSelection
setTimeout(