*really* fix hover placing.

This commit is contained in:
Olly Smith 2012-10-28 21:22:10 +00:00
parent a8d60d03fe
commit 5192f678dc
3 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ class Morris.Line extends Morris.Grid
@hover.attr 'width', maxLabelWidth + @options.hoverPaddingX * 2
@hover.attr 'x', -@options.hoverPaddingX - maxLabelWidth / 2
# move to y pos
yloc = Math.min.apply null, (y for y in row._y when y is not null).concat(@top)
yloc = Math.min.apply null, (y for y in row._y when y isnt null).concat(@bottom)
if yloc > @hoverHeight + @options.hoverPaddingY * 2 + @options.hoverMargin + @top
yloc = yloc - @hoverHeight / 2 - @options.hoverPaddingY - @options.hoverMargin
else

View File

@ -671,12 +671,12 @@
_results = [];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
y = _ref1[_j];
if (y === !null) {
if (y !== null) {
_results.push(y);
}
}
return _results;
})()).concat(this.top));
})()).concat(this.bottom));
if (yloc > this.hoverHeight + this.options.hoverPaddingY * 2 + this.options.hoverMargin + this.top) {
yloc = yloc - this.hoverHeight / 2 - this.options.hoverPaddingY - this.options.hoverMargin;
} else {

2
morris.min.js vendored

File diff suppressed because one or more lines are too long