diff options
author | anekos | 2010-03-27 14:25:41 +0000 |
---|---|---|
committer | anekos | 2010-03-27 14:25:41 +0000 |
commit | af22c26acf5dd830e56abfcb654d21ac11464997 (patch) | |
tree | 86919003cb6fb22096b0c0de6b5c3d5c20cdd1d1 /spatial-navigation.js | |
parent | 3b086a756a0cf8929932423899e46a8b9c369ad7 (diff) | |
download | vimperator-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-x | spatial-navigation.js | 21 |
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) { |