mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
parent
819f40b3d4
commit
b3b8377c53
@ -223,10 +223,10 @@ class Morris.Line
|
|||||||
hideHover()
|
hideHover()
|
||||||
updateHilight = (x) =>
|
updateHilight = (x) =>
|
||||||
x -= @el.offset().left
|
x -= @el.offset().left
|
||||||
for i in [hoverMargins.length..1]
|
for hoverIndex in [hoverMargins.length..0]
|
||||||
if hoverMargins[i - 1] > x
|
if hoverIndex == 0 || hoverMargins[hoverIndex - 1] > x
|
||||||
|
hilight hoverIndex
|
||||||
break
|
break
|
||||||
hilight i
|
|
||||||
@el.mousemove (evt) =>
|
@el.mousemove (evt) =>
|
||||||
updateHilight evt.pageX
|
updateHilight evt.pageX
|
||||||
touchHandler = (evt) =>
|
touchHandler = (evt) =>
|
||||||
|
14
morris.js
14
morris.js
@ -230,12 +230,18 @@
|
|||||||
if (index === null) return hideHover();
|
if (index === null) return hideHover();
|
||||||
};
|
};
|
||||||
updateHilight = function(x) {
|
updateHilight = function(x) {
|
||||||
var i, _ref9;
|
var hoverIndex, _ref9, _results;
|
||||||
x -= _this.el.offset().left;
|
x -= _this.el.offset().left;
|
||||||
for (i = _ref9 = hoverMargins.length; _ref9 <= 1 ? i <= 1 : i >= 1; _ref9 <= 1 ? i++ : i--) {
|
_results = [];
|
||||||
if (hoverMargins[i - 1] > x) break;
|
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) {
|
this.el.mousemove(function(evt) {
|
||||||
return updateHilight(evt.pageX);
|
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