diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dom_utils.coffee | 10 | ||||
| -rw-r--r-- | lib/settings.coffee | 10 |
2 files changed, 17 insertions, 3 deletions
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..da45eb61 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -170,6 +170,7 @@ Settings = newTabUrl: "chrome://newtab" grabBackFocus: false regexFindMode: false + waitForEnterForFilteredHints: false # Note: this defaults to true for new users; see below. settingsVersion: Utils.getCurrentVersion() helpDialog_showAdvancedCommands: false @@ -181,6 +182,15 @@ Settings.init() # Perform migration from old settings versions, if this is the background page. if Utils.isBackgroundPage() + if not Settings.get "settingsVersion" + # This is a new install. For some settings, we retain a legacy default behaviour for existing users but + # use a non-default behaviour for new users. + + # For waitForEnterForFilteredHints, we (smblott) think that "true" gives a better UX; see #1950. However, + # forcing the change on existing users would be unnecessarily disruptive. So, only new users default to + # "true". + Settings.set "waitForEnterForFilteredHints", true + # We use settingsVersion to coordinate any necessary schema changes. Settings.set("settingsVersion", Utils.getCurrentVersion()) |
