Browse Source

Add a `getContainerHeight` option

Casey Holzer 9 years ago
parent
commit
b09ff709f6
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Calendar.js

+ 4 - 0
src/Calendar.js

@@ -728,6 +728,10 @@ function Calendar_constructor(element, overrides) {
 	
 	
 	
 	
 	function _calcSize() { // assumes elementVisible
 	function _calcSize() { // assumes elementVisible
+		if (typeof t.options.getContainerHeight === 'function') {
+			suggestedViewHeight = t.options.getContainerHeight() - (headerElement ? headerElement.outerHeight(true) : 0);
+			return;
+		}
 		if (typeof t.options.contentHeight === 'number') { // exists and not 'auto'
 		if (typeof t.options.contentHeight === 'number') { // exists and not 'auto'
 			suggestedViewHeight = t.options.contentHeight;
 			suggestedViewHeight = t.options.contentHeight;
 		}
 		}