From b6db9c2cc70cdfe06a0da94f2fa45d35d7e04b5e Mon Sep 17 00:00:00 2001 From: janus_wel Date: Thu, 27 Nov 2008 16:12:25 +0000 Subject: bugfix: bad initialization git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25156 d0d07461-0603-4401-acd4-de1884942a52 --- mouseinspect.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'mouseinspect.js') 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 - * @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); }, {} -- cgit v1.2.3