Change bodyVisible to check the body element actually exists before accessing offsetWidth.

This prevents errors if FC is used before the DOM has loaded (ie. on an invisible element).
This commit is contained in:
James McLaughlin 2012-01-02 16:56:30 +00:00
parent 56ae9f1cbf
commit 418399988a

View file

@ -125,7 +125,8 @@ function Calendar(element, options, eventSources) {
function bodyVisible() {
return $('body')[0].offsetWidth !== 0;
var body = $('body');
return body.length > 0 && body [0].offsetWidth !== 0;
}