aboutsummaryrefslogtreecommitdiffstats
path: root/spatial-navigation.js
diff options
context:
space:
mode:
authoranekos2010-03-27 14:25:41 +0000
committeranekos2010-03-27 14:25:41 +0000
commitaf22c26acf5dd830e56abfcb654d21ac11464997 (patch)
tree86919003cb6fb22096b0c0de6b5c3d5c20cdd1d1 /spatial-navigation.js
parent3b086a756a0cf8929932423899e46a8b9c369ad7 (diff)
downloadvimperator-plugins-af22c26acf5dd830e56abfcb654d21ac11464997.tar.bz2
blur 時に flasher を外す様にした
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37102 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'spatial-navigation.js')
-rwxr-xr-xspatial-navigation.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/spatial-navigation.js b/spatial-navigation.js
index c1e610e..01f2954 100755
--- a/spatial-navigation.js
+++ b/spatial-navigation.js
@@ -290,19 +290,28 @@ let INFO =
flashFocusedElement();
}
- flasher = Cc['@mozilla.org/inspector/flasher;1'].createInstance(Ci.inIFlasher);
+ const flasher = Cc['@mozilla.org/inspector/flasher;1'].createInstance(Ci.inIFlasher);
flasher.color = '#FF0000';
flasher.thickness = 2;
function flashFocusedElement () {
let elem = getFocusedElement();
- liberator.log(elem);
if (!elem)
return;
- setTimeout(function () {
- flasher.drawElementOutline(elem);
- setTimeout(function () flasher.repaintElement(elem), 100);
- }, 0);
+ setTimeout(
+ function () {
+ flasher.drawElementOutline(elem);
+ elem.addEventListener(
+ 'blur',
+ function () {
+ elem.removeEventListener(arguments.callee);
+ flasher.repaintElement(elem);
+ },
+ false
+ );
+ },
+ 0
+ );
}
function focusElement (elem) {