From 007b36d47cb425630d20319ccf4c0a62dda450c3 Mon Sep 17 00:00:00 2001 From: taxicala Date: Wed, 27 Aug 2014 14:57:53 -0300 Subject: [PATCH] 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. --- morris.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/morris.js b/morris.js index ab404db..8cba641 100644 --- a/morris.js +++ b/morris.js @@ -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;