From 5044683aec359b4094b67e21ba39a4ee20cdb9f4 Mon Sep 17 00:00:00 2001 From: FagnerMartinsBrack Date: Mon, 27 Jun 2011 08:22:40 -0700 Subject: [PATCH 1/2] Calendar.js: Allow the use of height: 'auto' to remove the Agenda ScrollBar. Fixed #521 - Can't Remove Agenda ScrollBar --- src/Calendar.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Calendar.js b/src/Calendar.js index d32595b..9f8f320 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -1,4 +1,3 @@ - function Calendar(element, options, eventSources) { var t = this; @@ -262,11 +261,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)); } } From bb1078959cbdfba969138e0522c6ac85aac60869 Mon Sep 17 00:00:00 2001 From: FagnerMartinsBrack Date: Mon, 27 Jun 2011 08:24:06 -0700 Subject: [PATCH 2/2] Calendar.js: Allow the use of height: 'auto' to remove the Agenda ScrollBar. Fixed #521 - Can't Remove Agenda ScrollBar --- src/agenda/AgendaView.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/agenda/AgendaView.js b/src/agenda/AgendaView.js index 2a4373c..53ff527 100644 --- a/src/agenda/AgendaView.js +++ b/src/agenda/AgendaView.js @@ -1,4 +1,3 @@ - setDefaults({ allDaySlot: true, allDayText: 'all-day', @@ -334,19 +333,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) {