From be5205e6153e39d7c08f229c2b9183fab153f823 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 29 Jan 2016 14:16:20 +0000 Subject: Wait-for-enter: for filtered hints. This affects filtered hints only. If a hint is triggered because the user typed the link text, then: - highlight the link - but wait until the user types `Enter` before activating the link. --- lib/dom_utils.coffee | 10 +++++++--- lib/settings.coffee | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 7473df17..db90c43a 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -262,8 +262,7 @@ DomUtils = # but Webkit will. Dispatching a click on an input box does not seem to focus it; we do that separately element.dispatchEvent(mouseEvent) - # momentarily flash a rectangular border to give user some visual feedback - flashRect: (rect) -> + addFlashRect: (rect) -> flashEl = @createElement "div" flashEl.id = "vimiumFlash" flashEl.className = "vimiumReset" @@ -271,7 +270,12 @@ DomUtils = flashEl.style.top = rect.top + window.scrollY + "px" flashEl.style.width = rect.width + "px" flashEl.style.height = rect.height + "px" - document.documentElement.appendChild(flashEl) + document.documentElement.appendChild flashEl + flashEl + + # momentarily flash a rectangular border to give user some visual feedback + flashRect: (rect) -> + flashEl = @addFlashRect rect setTimeout((-> DomUtils.removeElement flashEl), 400) suppressPropagation: (event) -> diff --git a/lib/settings.coffee b/lib/settings.coffee index 79ee04a9..a33a88e8 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -170,6 +170,7 @@ Settings = newTabUrl: "chrome://newtab" grabBackFocus: false regexFindMode: false + waitForEnterForFilteredHints: true # Once properly implmented, this will default to false. settingsVersion: Utils.getCurrentVersion() helpDialog_showAdvancedCommands: false -- cgit v1.2.3