Przeglądaj źródła

use jQuery to detect if body/calendar-element is visible and ready for rendering

Adam Shaw 12 lat temu
rodzic
commit
fec455dbfc
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/Calendar.js

+ 2 - 2
src/Calendar.js

@@ -127,12 +127,12 @@ function Calendar(element, options, eventSources) {
 	
 	
 	
 	
 	function elementVisible() {
 	function elementVisible() {
-		return _element.offsetWidth !== 0;
+		return element.is(':visible');
 	}
 	}
 	
 	
 	
 	
 	function bodyVisible() {
 	function bodyVisible() {
-		return $('body')[0].offsetWidth !== 0;
+		return $('body').is(':visible');
 	}
 	}