From a26c50d33493782ec6cb19cbec9c12e5e48a0f8f Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sun, 4 Mar 2012 05:54:27 -0500 Subject: 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. --- lib/domUtils.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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); + }, + }; -- cgit v1.2.3