Просмотр исходного кода

Add a `getContainerHeight` option

this makes it a lot easier to size the control to its container. for example, implementations could do `return container_el.clientHeight`
aharpervc 10 лет назад
Родитель
Сommit
52caeec86c
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/Calendar.js

+ 4 - 0
src/Calendar.js

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