Check to ensure dom node exists when calculating size. Fixes #919

This commit is contained in:
etimberg 2016-02-07 19:23:54 -05:00
parent 126e318fef
commit cf0b550a80

View File

@ -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 ?