diff options
author | janus_wel | 2008-11-27 16:12:25 +0000 |
---|---|---|
committer | janus_wel | 2008-11-27 16:12:25 +0000 |
commit | b6db9c2cc70cdfe06a0da94f2fa45d35d7e04b5e (patch) | |
tree | 43a4ee87b56bbc2aeac05cc4a8b0c3b1e785c4aa /mouseinspect.js | |
parent | 778fa1fdc342fe0fbb23aaeee704a8f8e11fbe05 (diff) | |
download | vimperator-plugins-b6db9c2cc70cdfe06a0da94f2fa45d35d7e04b5e.tar.bz2 |
bugfix: bad initialization
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25156 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'mouseinspect.js')
-rw-r--r-- | mouseinspect.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/mouseinspect.js b/mouseinspect.js index 9117f75..b28d1f0 100644 --- a/mouseinspect.js +++ b/mouseinspect.js @@ -4,7 +4,7 @@ * @description display informations of the specified element and highlight it by mouse. * @description-ja マウスで指定した要素の情報をコマンドラインに表示&ハイライトする。 * @author janus_wel <janus_wel@fb3.so-net.ne.jp> - * @version 0.20 + * @version 0.21 * @minversion 2.0pre 2008/10/16 * ==/VimperatorPlugin== * @@ -62,17 +62,22 @@ let elementInfo = function (event) { elementInfo.highlighter.highlight(element); }; +let setupHighlighter = function () { + elementInfo.highlighter = plugins.highlighterFactory({ + color: liberator.globalVariables.mouse_inspect_color || defaultColor, + opacity: liberator.globalVariables.mouse_inspect_opacity || defaultOpacity, + interval: 0, + }); +} + +setupHighlighter(); + // register commands commands.addUserCommand( ['mouseinspect', 'mins'], 'mouse', function () { - elementInfo.highlighter = plugins.highlighterFactory({ - color: liberator.globalVariables.mouse_inspect_color || defaultColor, - opacity: liberator.globalVariables.mouse_inspect_opacity || defaultOpacity, - interval: 0, - }); - + setupHighlighter(); window.addEventListener('mousemove', elementInfo, false); }, {} |