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 /lib | |
| 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 'lib')
| -rw-r--r-- | lib/domUtils.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/domUtils.js b/lib/domUtils.js index cfb1202b..c1bdcdde 100644 --- a/lib/domUtils.js +++ b/lib/domUtils.js @@ -105,4 +105,13 @@ var domUtils = { } }, + // momentarily flash a border around an element to give user some visual feedback + flashElement: function(element) { + var oldBorderValue = element.style.border; + element.style.border = '1px solid #66f'; + setTimeout(function() { + element.style.border = oldBorderValue; + }, 400); + }, + }; |
