mirror of https://github.com/gorhill/uBlock.git
minor code review
This commit is contained in:
parent
3f9b704846
commit
67950ec135
|
@ -737,22 +737,20 @@ var elementFromPoint = function(x, y) {
|
||||||
|
|
||||||
var onSvgHovered = (function() {
|
var onSvgHovered = (function() {
|
||||||
var timer = null;
|
var timer = null;
|
||||||
var position = { x: 0, y: 0 };
|
var mx = 0, my = 0;
|
||||||
|
|
||||||
var onTimer = function() {
|
var onTimer = function() {
|
||||||
timer = null;
|
timer = null;
|
||||||
var elem = elementFromPoint(position.x, position.y);
|
var elem = elementFromPoint(mx, my);
|
||||||
highlightElements(elem ? [elem] : []);
|
highlightElements(elem ? [elem] : []);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onMove = function(ev) {
|
var onMove = function(ev) {
|
||||||
position.x = ev.clientX;
|
mx = ev.clientX;
|
||||||
position.y = ev.clientY;
|
my = ev.clientY;
|
||||||
if ( timer !== null ) {
|
if ( timer === null ) {
|
||||||
return;
|
timer = vAPI.setTimeout(onTimer, 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
timer = vAPI.setTimeout(onTimer, 40);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return onMove;
|
return onMove;
|
||||||
|
|
Loading…
Reference in New Issue