diff options
| author | mrmr1993 | 2015-05-28 22:22:40 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-06-10 17:21:22 +0100 |
| commit | 91077b021e24f5ed6a8505e4e2afb97cdc2cbbb0 (patch) | |
| tree | ba06aa6626669158d06524bf968b40db8dc07bef /content_scripts/hud.coffee | |
| parent | 85aa76ec68167ea0ac08cc627b3f12e1077b1b1f (diff) | |
| download | vimium-91077b021e24f5ed6a8505e4e2afb97cdc2cbbb0.tar.bz2 | |
Make all find mode updates go via the HUD in preparation to use an input
Diffstat (limited to 'content_scripts/hud.coffee')
| -rw-r--r-- | content_scripts/hud.coffee | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index 3e749da5..64ebd8e3 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -28,12 +28,25 @@ HUD = showFindMode: (text = "") -> return unless @enabled() + # NOTE(mrmr1993): We set findModeQuery.rawQuery here rather in search while we still handle keys in the + # main frame. When key handling is moved to the HUD iframe, this line should be deleted, and the + # equivalent in search should be uncommented. + findModeQuery.rawQuery = text @hudUI.show {name: "showFindMode", text} @tween.fade 1.0, 150 updateMatchesCount: (matchCount, showMatchText = true) -> @hudUI.postMessage {name: "updateMatchesCount", matchCount, showMatchText} + search: (data) -> + # NOTE(mrmr1993): The following line is disabled as it is currently vulnerable to a race condition when a + # user types quickly. When all of the key handling is done in the HUD iframe, this should be uncommented, + # and the equivalent line in showFindMode should be deleted. + #findModeQuery.rawQuery = data.query + updateFindModeQuery() + performFindInPlace() + showFindModeHUDForQuery() + # Hide the HUD. # If :immediate is falsy, then the HUD is faded out smoothly (otherwise it is hidden immediately). # If :updateIndicator is truthy, then we also refresh the mode indicator. The only time we don't update the |
