Fixed flying legend issues

Sometimes the legend does not display correctly as outerWidth and outerHeight of the rows do not return a number, returning the element itself instead. If you pass an additional parameter to these two functions (includeMargin) seems to fix the issues.
This commit is contained in:
taxicala 2014-08-27 14:57:53 -03:00
parent ef8b3f3276
commit 007b36d47c

View File

@ -68,7 +68,7 @@ Licensed under the BSD-2-Clause License.
Morris.pad2 = function(number) {
return (number < 10 ? '0' : '') + number;
};
};ou
Morris.Grid = (function(_super) {
__extends(Grid, _super);
@ -680,8 +680,8 @@ Licensed under the BSD-2-Clause License.
var hoverHeight, hoverWidth, left, parentHeight, parentWidth, top;
parentWidth = this.options.parent.innerWidth();
parentHeight = this.options.parent.innerHeight();
hoverWidth = this.el.outerWidth();
hoverHeight = this.el.outerHeight();
hoverWidth = this.el.outerWidth(true);
hoverHeight = this.el.outerHeight(true);
left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth);
if (y != null) {
top = y - hoverHeight - 10;