mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-09-21 02:31:32 +02:00
parent
819f40b3d4
commit
b3b8377c53
@ -223,10 +223,10 @@ class Morris.Line
|
||||
hideHover()
|
||||
updateHilight = (x) =>
|
||||
x -= @el.offset().left
|
||||
for i in [hoverMargins.length..1]
|
||||
if hoverMargins[i - 1] > x
|
||||
for hoverIndex in [hoverMargins.length..0]
|
||||
if hoverIndex == 0 || hoverMargins[hoverIndex - 1] > x
|
||||
hilight hoverIndex
|
||||
break
|
||||
hilight i
|
||||
@el.mousemove (evt) =>
|
||||
updateHilight evt.pageX
|
||||
touchHandler = (evt) =>
|
||||
|
14
morris.js
14
morris.js
@ -230,12 +230,18 @@
|
||||
if (index === null) return hideHover();
|
||||
};
|
||||
updateHilight = function(x) {
|
||||
var i, _ref9;
|
||||
var hoverIndex, _ref9, _results;
|
||||
x -= _this.el.offset().left;
|
||||
for (i = _ref9 = hoverMargins.length; _ref9 <= 1 ? i <= 1 : i >= 1; _ref9 <= 1 ? i++ : i--) {
|
||||
if (hoverMargins[i - 1] > x) break;
|
||||
_results = [];
|
||||
for (hoverIndex = _ref9 = hoverMargins.length; _ref9 <= 0 ? hoverIndex <= 0 : hoverIndex >= 0; _ref9 <= 0 ? hoverIndex++ : hoverIndex--) {
|
||||
if (hoverIndex === 0 || hoverMargins[hoverIndex - 1] > x) {
|
||||
hilight(hoverIndex);
|
||||
break;
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return hilight(i);
|
||||
return _results;
|
||||
};
|
||||
this.el.mousemove(function(evt) {
|
||||
return updateHilight(evt.pageX);
|
||||
|
2
morris.min.js
vendored
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user