diff --git a/src/Calendar.js b/src/Calendar.js index 51f3fa5..a465716 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -1,4 +1,3 @@ - function Calendar(element, options, eventSources) { var t = this; @@ -263,11 +262,13 @@ function Calendar(element, options, eventSources) { function calcSize() { if (options.contentHeight) { suggestedViewHeight = options.contentHeight; - } - else if (options.height) { - suggestedViewHeight = options.height - (headerElement ? headerElement.height() : 0) - vsides(content); - } - else { + } else if (options.height) { + if(options.height.toString().match(new RegExp("^[0-9]+(px)?$"))) { + suggestedViewHeight = parseInt(options.height) - (headerElement ? headerElement.height() : 0) - vsides(content); + } else { + suggestedViewHeight = options.height; + } + } else { suggestedViewHeight = Math.round(content.width() / Math.max(options.aspectRatio, .5)); } } diff --git a/src/agenda/AgendaView.js b/src/agenda/AgendaView.js index 87510a7..fdad812 100644 --- a/src/agenda/AgendaView.js +++ b/src/agenda/AgendaView.js @@ -335,19 +335,22 @@ function AgendaView(element, calendar, viewName) { slotTopCache = {}; var headHeight = dayBody.position().top; - var allDayHeight = slotScroller.position().top; // including divider - var bodyHeight = Math.min( // total body height, including borders - height - headHeight, // when scrollbars - slotTable.height() + allDayHeight + 1 // when no scrollbars. +1 for bottom border - ); - - dayBodyFirstCellStretcher - .height(bodyHeight - vsides(dayBodyFirstCell)); + if($.type(height) === 'number') { + var allDayHeight = slotScroller.position().top; // including divider + var bodyHeight = Math.min( // total body height, including borders + height - headHeight, // when scrollbars + slotTable.height() + allDayHeight + 1 // when no scrollbars. +1 for bottom border + ); + + slotScroller.height(bodyHeight - allDayHeight - 1); + dayBodyFirstCellStretcher.height(bodyHeight - vsides(dayBodyFirstCell)); + } else { + slotScroller.height(height); + dayBodyFirstCellStretcher.height(slotScroller.height()); + } slotLayer.css('top', headHeight); - slotScroller.height(bodyHeight - allDayHeight - 1); - slotHeight = slotTableFirstInner.height() + 1; // +1 for border if (dateChanged) {