diff options
| author | Jez Ng | 2012-03-04 05:54:27 -0500 |
|---|---|---|
| committer | Jez Ng | 2012-03-06 08:43:10 -0500 |
| commit | a26c50d33493782ec6cb19cbec9c12e5e48a0f8f (patch) | |
| tree | 276bc3ceac330177769eac3f6178f1978687c7c8 /linkHints.js | |
| parent | 9fb216784414c8630b51ebd6d67fb4df3ca36e84 (diff) | |
| download | vimium-a26c50d33493782ec6cb19cbec9c12e5e48a0f8f.tar.bz2 | |
Indicate clicked element via border style rather than focus.
This makes it slightly more obvious, and it promotes decoupling --
changing focus affects a lot of other behavior, and it's more elegant
not to have to juggle that.
Diffstat (limited to 'linkHints.js')
| -rw-r--r-- | linkHints.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/linkHints.js b/linkHints.js index e25dab9a..8f278175 100644 --- a/linkHints.js +++ b/linkHints.js @@ -206,14 +206,11 @@ var linkHints = { domUtils.simulateSelect(matchedLink); this.deactivateMode(delay, function() { that.delayMode = false; }); } else { - // focus the link momentarily to give user some visual feedback - matchedLink.focus(); - setTimeout(function() { - // TODO(int3): do this for @role='link' and similar elements as well - var nodeName = matchedLink.nodeName.toLowerCase(); - if (nodeName == 'a' || nodeName == 'button') - matchedLink.blur(); - }, 400); + // TODO figure out which other input elements should not receive focus + if (matchedLink.nodeName.toLowerCase() === 'input' && + matchedLink.type !== 'button') + matchedLink.focus(); + domUtils.flashElement(matchedLink); this.linkActivator(matchedLink); if (this.shouldOpenWithQueue) { this.deactivateMode(delay, function() { |
