mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
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:
parent
ef8b3f3276
commit
007b36d47c
@ -68,7 +68,7 @@ Licensed under the BSD-2-Clause License.
|
|||||||
|
|
||||||
Morris.pad2 = function(number) {
|
Morris.pad2 = function(number) {
|
||||||
return (number < 10 ? '0' : '') + number;
|
return (number < 10 ? '0' : '') + number;
|
||||||
};
|
};ou
|
||||||
|
|
||||||
Morris.Grid = (function(_super) {
|
Morris.Grid = (function(_super) {
|
||||||
__extends(Grid, _super);
|
__extends(Grid, _super);
|
||||||
@ -680,8 +680,8 @@ Licensed under the BSD-2-Clause License.
|
|||||||
var hoverHeight, hoverWidth, left, parentHeight, parentWidth, top;
|
var hoverHeight, hoverWidth, left, parentHeight, parentWidth, top;
|
||||||
parentWidth = this.options.parent.innerWidth();
|
parentWidth = this.options.parent.innerWidth();
|
||||||
parentHeight = this.options.parent.innerHeight();
|
parentHeight = this.options.parent.innerHeight();
|
||||||
hoverWidth = this.el.outerWidth();
|
hoverWidth = this.el.outerWidth(true);
|
||||||
hoverHeight = this.el.outerHeight();
|
hoverHeight = this.el.outerHeight(true);
|
||||||
left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth);
|
left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth);
|
||||||
if (y != null) {
|
if (y != null) {
|
||||||
top = y - hoverHeight - 10;
|
top = y - hoverHeight - 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user