From b61b9d5682fb9e79a4057fc5066e3f5db9f4ff53 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Mon, 21 Dec 2009 19:19:41 -0800 Subject: [PATCH] clean aspectRatio option, setting height right after init bugfix, ie6 button positioning bugfix, nixed cache option --- src/agenda.js | 2 +- src/css/main.css | 1 - src/grid.js | 2 +- src/main.js | 6 +-- src/util.js | 1 + tests/issue_220_buttons_ie6.html | 51 +++++++++++++++++++++++++ tests/issue_230_height_json_events.html | 45 ++++++++++++++++++++++ tests/issue_244_aspectRatio_0.html | 44 +++++++++++++++++++++ tests/loader.js | 4 +- 9 files changed, 149 insertions(+), 7 deletions(-) create mode 100644 tests/issue_220_buttons_ie6.html create mode 100644 tests/issue_230_height_json_events.html create mode 100644 tests/issue_244_aspectRatio_0.html diff --git a/src/agenda.js b/src/agenda.js index 87be57f..defa293 100644 --- a/src/agenda.js +++ b/src/agenda.js @@ -68,7 +68,7 @@ function Agenda(element, options, methods) { var head, body, bodyContent, bodyTable, bg, colCnt, axisWidth, colWidth, slotHeight, - cachedDaySegs, cachedSlotSegs, + cachedDaySegs=[], cachedSlotSegs=[], cachedHeight, tm, firstDay, nwe, // no weekends (int) diff --git a/src/css/main.css b/src/css/main.css index dc5782a..6e200b6 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -101,7 +101,6 @@ table.fc-header { .fc-header .fc-state-default a { display: block; - position: relative; border-width: 0 1px; margin: 0 -1px; width: 100%; diff --git a/src/grid.js b/src/grid.js index 4fcc67b..de07640 100644 --- a/src/grid.js +++ b/src/grid.js @@ -115,7 +115,7 @@ function Grid(element, options, methods) { rowCnt, colCnt, colWidth, thead, tbody, - cachedSegs, //... + cachedSegs=[], //... // initialize superclass view = $.extend(this, viewMethods, methods, { diff --git a/src/main.js b/src/main.js index 69d80ec..0901066 100644 --- a/src/main.js +++ b/src/main.js @@ -28,7 +28,6 @@ var defaults = { // event ajax startParam: 'start', endParam: 'end', - cache: false, // time formats titleFormat: { @@ -304,7 +303,7 @@ $.fn.fullCalendar = function(options) { else if (options.height) { return options.height - (header ? header.height() : 0) - horizontalSides(content); } - return elementWidth / options.aspectRatio; + return elementWidth / Math.max(options.aspectRatio, .5); } @@ -366,7 +365,7 @@ $.fn.fullCalendar = function(options) { url: src, dataType: 'json', data: params, - cache: options.cache, + cache: false, success: reportEventsAndPop }); } @@ -830,4 +829,5 @@ function normalizeEvent(event, options) { event.className = []; } } +// TODO: if there is no title or start date, return false to indicate an invalid event diff --git a/src/util.js b/src/util.js index 82344ea..41d9e2a 100644 --- a/src/util.js +++ b/src/util.js @@ -109,6 +109,7 @@ var parseDate = fc.parseDate = function(s) { } return parseISO8601(s, true) || (s ? new Date(s) : null); } + // TODO: never return invalid dates (like from new Date()), return null instead return null; } diff --git a/tests/issue_220_buttons_ie6.html b/tests/issue_220_buttons_ie6.html new file mode 100644 index 0000000..14527c0 --- /dev/null +++ b/tests/issue_220_buttons_ie6.html @@ -0,0 +1,51 @@ + + + + + + + + + +
+
+
+ +
Nav
+ +
+ +

+this is a paragraph +

+ +
+ +
+ +
+
+ + diff --git a/tests/issue_230_height_json_events.html b/tests/issue_230_height_json_events.html new file mode 100644 index 0000000..d2ee7ba --- /dev/null +++ b/tests/issue_230_height_json_events.html @@ -0,0 +1,45 @@ + + + + + + + + + +
+ + diff --git a/tests/issue_244_aspectRatio_0.html b/tests/issue_244_aspectRatio_0.html new file mode 100644 index 0000000..a0dc060 --- /dev/null +++ b/tests/issue_244_aspectRatio_0.html @@ -0,0 +1,44 @@ + + + + + + + + + +
+ + diff --git a/tests/loader.js b/tests/loader.js index 70068ae..7835617 100644 --- a/tests/loader.js +++ b/tests/loader.js @@ -85,7 +85,9 @@ if (_build) { includeJS('../src/gcal.js'); } -includeJS('firebug-lite/firebug-lite-compressed.js'); +if (!window.DISABLE_FIREBUG_LITE) { + includeJS('firebug-lite/firebug-lite-compressed.js'); +} window.onload = function() { $('body').append(