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).
master
James McLaughlin 2012-01-02 16:56:30 +00:00
parent 56ae9f1cbf
commit 418399988a
1 changed files with 2 additions and 1 deletions

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;
}