mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
Check to ensure dom node exists when calculating size. Fixes #919
This commit is contained in:
parent
126e318fef
commit
cf0b550a80
@ -839,13 +839,13 @@
|
||||
var container = domNode.parentNode,
|
||||
padding = parseInt(getStyle(container, 'padding-left')) + parseInt(getStyle(container, 'padding-right'));
|
||||
// TODO = check cross browser stuff with this.
|
||||
return container.clientWidth - padding;
|
||||
return container ? container.clientWidth - padding : 0;
|
||||
},
|
||||
getMaximumHeight = helpers.getMaximumHeight = function(domNode){
|
||||
var container = domNode.parentNode,
|
||||
padding = parseInt(getStyle(container, 'padding-bottom')) + parseInt(getStyle(container, 'padding-top'));
|
||||
// TODO = check cross browser stuff with this.
|
||||
return container.clientHeight - padding;
|
||||
return container ? container.clientHeight - padding : 0;
|
||||
},
|
||||
getStyle = helpers.getStyle = function (el, property) {
|
||||
return el.currentStyle ?
|
||||
|
Loading…
Reference in New Issue
Block a user