summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-10 16:17:48 +0200
committerSebastian Wagner2011-09-10 16:17:48 +0200
commit5f119f19dbbfaf64a9e1d6658575b13f12893288 (patch)
tree61a8cf54464c0bed09eb96698a1b6f677acb9d21 /public
parentdialog-titlebar-close = hide (diff)
downloadpoolctrl-5f119f19dbbfaf64a9e1d6658575b13f12893288.tar.gz
poolctrl-5f119f19dbbfaf64a9e1d6658575b13f12893288.tar.xz
poolctrl-5f119f19dbbfaf64a9e1d6658575b13f12893288.zip
minor
Diffstat (limited to 'public')
-rw-r--r--public/media/js/fullcalendar.js708
1 files changed, 479 insertions, 229 deletions
diff --git a/public/media/js/fullcalendar.js b/public/media/js/fullcalendar.js
index 73e6f35..9df34f4 100644
--- a/public/media/js/fullcalendar.js
+++ b/public/media/js/fullcalendar.js
@@ -1,18 +1,14 @@
/**
- * @preserve
- * FullCalendar v1.5.1
- * http://arshaw.com/fullcalendar/
- *
- * Use fullcalendar.css for basic styling.
- * For event drag & drop, requires jQuery UI draggable.
- * For event resizing, requires jQuery UI resizable.
- *
- * Copyright (c) 2011 Adam Shaw
- * Dual licensed under the MIT and GPL licenses, located in
- * MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
- *
+ * @preserve FullCalendar v1.5.1 http://arshaw.com/fullcalendar/
+ *
+ * Use fullcalendar.css for basic styling. For event drag & drop, requires
+ * jQuery UI draggable. For event resizing, requires jQuery UI resizable.
+ *
+ * Copyright (c) 2011 Adam Shaw Dual licensed under the MIT and GPL licenses,
+ * located in MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
+ *
* Date: Sat Apr 9 14:09:51 2011 -0700
- *
+ *
*/
(function($, undefined) {
@@ -31,9 +27,9 @@ var defaults = {
weekends: true,
// editing
- //editable: false,
- //disableDragging: false,
- //disableResizing: false,
+ // editable: false,
+ // disableDragging: false,
+ // disableResizing: false,
allDayDefault: true,
ignoreTimezone: true,
@@ -83,7 +79,7 @@ var defaults = {
next: 'circle-triangle-e'
},
- //selectable: false,
+ // selectable: false,
unselectAuto: true,
dropAccept: '*'
@@ -141,7 +137,8 @@ $.fn.fullCalendar = function(options) {
}
- // would like to have this logic in EventManager, but needs to happen before options are recursively extended
+ // would like to have this logic in EventManager, but needs to happen before
+ // options are recursively extended
var eventSources = options.eventSources || [];
delete options.eventSources;
if (options.events) {
@@ -160,7 +157,8 @@ $.fn.fullCalendar = function(options) {
this.each(function(i, _element) {
var element = $(_element);
var calendar = new Calendar(element, options, eventSources);
- element.data('fullCalendar', calendar); // TODO: look into memory leak implications
+ element.data('fullCalendar', calendar); // TODO: look into memory leak
+ // implications
calendar.render();
});
@@ -233,8 +231,10 @@ function Calendar(element, options, eventSources) {
- /* Main Rendering
- -----------------------------------------------------------------------------*/
+ /*
+ * Main Rendering
+ * -----------------------------------------------------------------------------
+ */
setYMD(date, options.year, options.month, options.date);
@@ -270,18 +270,24 @@ function Calendar(element, options, eventSources) {
}
changeView(options.defaultView);
$(window).resize(windowResize);
- // needed for IE in a 0x0 iframe, b/c when it is resized, never triggers a windowResize
+ // needed for IE in a 0x0 iframe, b/c when it is resized, never triggers
+ // a windowResize
if (!bodyVisible()) {
lateRender();
}
}
- // called when we know the calendar couldn't be rendered when it was initialized,
+ // called when we know the calendar couldn't be rendered when it was
+ // initialized,
// but we think it's ready now
function lateRender() {
- setTimeout(function() { // IE7 needs this so dimensions are calculated correctly
- if (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once
+ setTimeout(function() { // IE7 needs this so dimensions are calculated
+ // correctly
+ if (!currentView.start && bodyVisible()) { // !currentView.start
+ // makes sure this never
+ // happens more than
+ // once
renderView();
}
},0);
@@ -308,14 +314,19 @@ function Calendar(element, options, eventSources) {
- /* View Rendering
- -----------------------------------------------------------------------------*/
+ /*
+ * View Rendering
+ * -----------------------------------------------------------------------------
+ */
- // TODO: improve view switching (still weird transition in IE, and FF has whiteout problem)
+ // TODO: improve view switching (still weird transition in IE, and FF has
+ // whiteout problem)
function changeView(newViewName) {
if (!currentView || newViewName != currentView.name) {
- ignoreWindowResize++; // because setMinHeight might change the height before render (and subsequently setSize) is reached
+ ignoreWindowResize++; // because setMinHeight might change the
+ // height before render (and subsequently
+ // setSize) is reached
unselect();
@@ -323,11 +334,16 @@ function Calendar(element, options, eventSources) {
var newViewElement;
if (oldView) {
- (oldView.beforeHide || noop)(); // called before changing min-height. if called after, scroll state is reset (in Opera)
+ (oldView.beforeHide || noop)(); // called before changing
+ // min-height. if called after,
+ // scroll state is reset (in
+ // Opera)
setMinHeight(content, content.height());
oldView.element.hide();
}else{
- setMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or else view dimensions miscalculated
+ setMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or
+ // else view dimensions
+ // miscalculated
}
content.css('overflow', 'hidden');
@@ -348,7 +364,9 @@ function Calendar(element, options, eventSources) {
}
header.activateButton(newViewName);
- renderView(); // after height has been set, will make absoluteViewElement's position=relative, then set to null
+ renderView(); // after height has been set, will make
+ // absoluteViewElement's position=relative, then set
+ // to null
content.css('overflow', '');
if (oldView) {
@@ -356,7 +374,10 @@ function Calendar(element, options, eventSources) {
}
if (!newViewElement) {
- (currentView.afterShow || noop)(); // called after setting min-height/overflow, so in final scroll state (for Opera)
+ (currentView.afterShow || noop)(); // called after setting
+ // min-height/overflow, so
+ // in final scroll state
+ // (for Opera)
}
ignoreWindowResize--;
@@ -367,7 +388,9 @@ function Calendar(element, options, eventSources) {
function renderView(inc) {
if (elementVisible()) {
- ignoreWindowResize++; // because renderEvents might temporarily change the height before setSize is reached
+ ignoreWindowResize++; // because renderEvents might temporarily
+ // change the height before setSize is
+ // reached
unselect();
@@ -377,8 +400,10 @@ function Calendar(element, options, eventSources) {
var forceEventRender = false;
if (!currentView.start || inc || date < currentView.start || date >= currentView.end) {
- // view must render an entire new date range (and refetch/render events)
- currentView.render(date, inc || 0); // responsible for clearing events
+ // view must render an entire new date range (and refetch/render
+ // events)
+ currentView.render(date, inc || 0); // responsible for clearing
+ // events
setSize(true);
forceEventRender = true;
}
@@ -413,8 +438,10 @@ function Calendar(element, options, eventSources) {
- /* Resizing
- -----------------------------------------------------------------------------*/
+ /*
+ * Resizing
+ * -----------------------------------------------------------------------------
+ */
function updateSize() {
@@ -469,7 +496,9 @@ function Calendar(element, options, eventSources) {
setTimeout(function() { // add a delay
if (uid == resizeUID && !ignoreWindowResize && elementVisible()) {
if (elementOuterWidth != (elementOuterWidth = element.outerWidth())) {
- ignoreWindowResize++; // in case the windowResize callback changes the height
+ ignoreWindowResize++; // in case the windowResize
+ // callback changes the
+ // height
updateSize();
currentView.trigger('windowResize', _element);
ignoreWindowResize--;
@@ -477,7 +506,8 @@ function Calendar(element, options, eventSources) {
}
}, 200);
}else{
- // calendar must have been initialized in a 0x0 iframe that has just been resized
+ // calendar must have been initialized in a 0x0 iframe that has
+ // just been resized
lateRender();
}
}
@@ -485,8 +515,10 @@ function Calendar(element, options, eventSources) {
- /* Event Fetching/Rendering
- -----------------------------------------------------------------------------*/
+ /*
+ * Event Fetching/Rendering
+ * -----------------------------------------------------------------------------
+ */
// fetches events if necessary, rerenders events if necessary (or if forced)
@@ -501,7 +533,8 @@ function Calendar(element, options, eventSources) {
function refetchEvents() {
- fetchEvents(currentView.visStart, currentView.visEnd); // will call reportEvents
+ fetchEvents(currentView.visStart, currentView.visEnd); // will call
+ // reportEvents
}
@@ -537,8 +570,10 @@ function Calendar(element, options, eventSources) {
- /* Selection
- -----------------------------------------------------------------------------*/
+ /*
+ * Selection
+ * -----------------------------------------------------------------------------
+ */
function select(start, end, allDay) {
@@ -554,8 +589,10 @@ function Calendar(element, options, eventSources) {
- /* Date
- -----------------------------------------------------------------------------*/
+ /*
+ * Date
+ * -----------------------------------------------------------------------------
+ */
function prev() {
@@ -616,8 +653,10 @@ function Calendar(element, options, eventSources) {
- /* Misc
- -----------------------------------------------------------------------------*/
+ /*
+ * Misc
+ * -----------------------------------------------------------------------------
+ */
function getView() {
@@ -647,8 +686,10 @@ function Calendar(element, options, eventSources) {
- /* External Dragging
- ------------------------------------------------------------------------*/
+ /*
+ * External Dragging
+ * ------------------------------------------------------------------------
+ */
if (options.droppable) {
$(document)
@@ -734,17 +775,29 @@ function Header(calendar, options) {
}else{
var buttonClick;
if (calendar[buttonName]) {
- buttonClick = calendar[buttonName]; // calendar method
+ buttonClick = calendar[buttonName]; // calendar
+ // method
}
else if (fcViews[buttonName]) {
buttonClick = function() {
- button.removeClass(tm + '-state-hover'); // forget why
+ button.removeClass(tm + '-state-hover'); // forget
+ // why
calendar.changeView(buttonName);
};
}
if (buttonClick) {
- var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null; // why are we using smartProperty here?
- var text = smartProperty(options.buttonText, buttonName); // why are we using smartProperty here?
+ var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null; // why
+ // are
+ // we
+ // using
+ // smartProperty
+ // here?
+ var text = smartProperty(options.buttonText, buttonName); // why
+ // are
+ // we
+ // using
+ // smartProperty
+ // here?
var button = $(
"<span class='fc-button fc-button-" + buttonName + " " + tm + "-state-default'>" +
"<span class='fc-button-inner'>" +
@@ -888,8 +941,10 @@ function EventManager(options, _sources) {
- /* Fetching
- -----------------------------------------------------------------------------*/
+ /*
+ * Fetching
+ * -----------------------------------------------------------------------------
+ */
function isFetchNeeded(start, end) {
@@ -1003,15 +1058,18 @@ function EventManager(options, _sources) {
- /* Sources
- -----------------------------------------------------------------------------*/
+ /*
+ * Sources
+ * -----------------------------------------------------------------------------
+ */
function addEventSource(source) {
source = _addEventSource(source);
if (source) {
pendingSourceCnt++;
- fetchEventSource(source, currentFetchID); // will eventually call reportEvents
+ fetchEventSource(source, currentFetchID); // will eventually call
+ // reportEvents
}
}
@@ -1044,8 +1102,10 @@ function EventManager(options, _sources) {
- /* Manipulation
- -----------------------------------------------------------------------------*/
+ /*
+ * Manipulation
+ * -----------------------------------------------------------------------------
+ */
function updateEvent(event) { // update an existing event
@@ -1053,8 +1113,19 @@ function EventManager(options, _sources) {
defaultEventEnd = getView().defaultEventEnd, // getView???
startDelta = event.start - event._start,
endDelta = event.end ?
- (event.end - (event._end || defaultEventEnd(event))) // event._end would be null if event.end
- : 0; // was null and event was just resized
+ (event.end - (event._end || defaultEventEnd(event))) // event._end
+ // would
+ // be
+ // null
+ // if
+ // event.end
+ : 0; // was
+ // null
+ // and
+ // event
+ // was
+ // just
+ // resized
for (i=0; i<len; i++) {
e = cache[i];
if (e._id == event._id && e != event) {
@@ -1143,8 +1214,10 @@ function EventManager(options, _sources) {
- /* Loading State
- -----------------------------------------------------------------------------*/
+ /*
+ * Loading State
+ * -----------------------------------------------------------------------------
+ */
function pushLoading() {
@@ -1162,8 +1235,10 @@ function EventManager(options, _sources) {
- /* Event Normalization
- -----------------------------------------------------------------------------*/
+ /*
+ * Event Normalization
+ * -----------------------------------------------------------------------------
+ */
function normalizeEvent(event) {
@@ -1192,13 +1267,16 @@ function EventManager(options, _sources) {
}else{
event.className = [];
}
- // TODO: if there is no start date, return false to indicate an invalid event
+ // TODO: if there is no start date, return false to indicate an invalid
+ // event
}
- /* Utils
- ------------------------------------------------------------------------------*/
+ /*
+ * Utils
+ * ------------------------------------------------------------------------------
+ */
function normalizeSource(source) {
@@ -1240,8 +1318,10 @@ fc.formatDates = formatDates;
-/* Date Math
------------------------------------------------------------------------------*/
+/*
+ * Date Math
+ * -----------------------------------------------------------------------------
+ */
var dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
DAY_MS = 86400000,
@@ -1292,7 +1372,8 @@ function addDays(d, n, keepTime) { // deals with daylight savings
}
-function fixDate(d, check) { // force d to be on check's YMD, for daylight savings purposes
+function fixDate(d, check) { // force d to be on check's YMD, for daylight
+ // savings purposes
if (+d) { // prevent infinite looping on invalid dates
while (d.getDate() != check.getDate()) {
d.setTime(+d + (d < check ? 1 : -1) * HOUR_MS);
@@ -1364,8 +1445,10 @@ function setYMD(date, y, m, d) {
-/* Date Parsing
------------------------------------------------------------------------------*/
+/*
+ * Date Parsing
+ * -----------------------------------------------------------------------------
+ */
function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
@@ -1384,7 +1467,8 @@ function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
}
return parseISO8601(s, ignoreTimezone) || (s ? new Date(s) : null);
}
- // TODO: never return invalid dates (like from new Date(<string>)), return null instead
+ // TODO: never return invalid dates (like from new Date(<string>)), return
+ // null instead
return null;
}
@@ -1463,8 +1547,10 @@ function parseTime(s) { // returns minutes since start of day
-/* Date Formatting
------------------------------------------------------------------------------*/
+/*
+ * Date Formatting
+ * -----------------------------------------------------------------------------
+ */
// TODO: use same function formatDate(date, [date2], format, [options])
@@ -1589,8 +1675,10 @@ var dateFormatters = {
fc.applyAll = applyAll;
-/* Event Date Math
------------------------------------------------------------------------------*/
+/*
+ * Event Date Math
+ * -----------------------------------------------------------------------------
+ */
function exclEndDay(event) {
@@ -1619,8 +1707,10 @@ function segsCollide(seg1, seg2) {
-/* Event Sorting
------------------------------------------------------------------------------*/
+/*
+ * Event Sorting
+ * -----------------------------------------------------------------------------
+ */
// event rendering utilities
@@ -1698,8 +1788,10 @@ function stackSegs(segs) {
-/* Event Element Binding
------------------------------------------------------------------------------*/
+/*
+ * Event Element Binding
+ * -----------------------------------------------------------------------------
+ */
function lazySegBind(container, segs, bindHandlers) {
@@ -1722,8 +1814,10 @@ function lazySegBind(container, segs, bindHandlers) {
-/* Element Dimensions
------------------------------------------------------------------------------*/
+/*
+ * Element Dimensions
+ * -----------------------------------------------------------------------------
+ */
function setOuterWidth(element, width, includeMargins) {
@@ -1801,12 +1895,14 @@ function setMinHeight(element, height) {
-/* Misc Utils
------------------------------------------------------------------------------*/
+/*
+ * Misc Utils
+ * -----------------------------------------------------------------------------
+ */
-//TODO: arraySlice
-//TODO: isFunction, grep ?
+// TODO: arraySlice
+// TODO: isFunction, grep ?
function noop() { }
@@ -1827,7 +1923,8 @@ function zeroPad(n) {
}
-function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
+function smartProperty(obj, name) { // get a camel-cased/namespaced property of
+ // an object
if (obj[name] !== undefined) {
return obj[name];
}
@@ -1867,13 +1964,9 @@ function disableTextSelection(element) {
/*
-function enableTextSelection(element) {
- element
- .attr('unselectable', 'off')
- .css('MozUserSelect', '')
- .unbind('selectstart.ui');
-}
-*/
+ * function enableTextSelection(element) { element .attr('unselectable', 'off')
+ * .css('MozUserSelect', '') .unbind('selectstart.ui'); }
+ */
function markFirstLast(e) {
@@ -2066,7 +2159,7 @@ function BasicWeekView(element, calendar) {
fcViews.basicDay = BasicDayView;
-//TODO: when calendar's date starts out on a weekend, shouldn't happen
+// TODO: when calendar's date starts out on a weekend, shouldn't happen
function BasicDayView(element, calendar) {
@@ -2179,8 +2272,9 @@ function BasicView(element, calendar, viewName) {
- /* Rendering
- ------------------------------------------------------------*/
+ /*
+ * Rendering ------------------------------------------------------------
+ */
disableTextSelection(element.addClass('fc-grid'));
@@ -2231,7 +2325,8 @@ function BasicView(element, calendar, viewName) {
"<tr>";
for (i=0; i<colCnt; i++) {
s +=
- "<th class='fc- " + headerClass + "'/>"; // need fc- for setDayID
+ "<th class='fc- " + headerClass + "'/>"; // need fc- for
+ // setDayID
}
s +=
"</tr>" +
@@ -2242,7 +2337,10 @@ function BasicView(element, calendar, viewName) {
"<tr class='fc-week" + i + "'>";
for (j=0; j<colCnt; j++) {
s +=
- "<td class='fc- " + contentClass + " fc-day" + (i*colCnt+j) + "'>" + // need fc- for setDayID
+ "<td class='fc- " + contentClass + " fc-day" + (i*colCnt+j) + "'>" + // need
+ // fc-
+ // for
+ // setDayID
"<div>" +
(showNumbers ?
"<div class='fc-day-number'/>" :
@@ -2272,7 +2370,8 @@ function BasicView(element, calendar, viewName) {
markFirstLast(head.add(head.find('tr'))); // marks first+last tr/th's
markFirstLast(bodyRows); // marks first+last td's
- bodyRows.eq(0).addClass('fc-first'); // fc-last is done in updateCells
+ bodyRows.eq(0).addClass('fc-first'); // fc-last is done in
+ // updateCells
dayBind(bodyCells);
@@ -2284,7 +2383,9 @@ function BasicView(element, calendar, viewName) {
function updateCells(firstTime) {
- var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
+ var dowDirty = firstTime || rowCnt == 1; // could the cells'
+ // day-of-weeks need
+ // updating?
var month = t.start.getMonth();
var today = clearTime(new Date());
var cell;
@@ -2373,8 +2474,10 @@ function BasicView(element, calendar, viewName) {
- /* Day clicking and binding
- -----------------------------------------------------------*/
+ /*
+ * Day clicking and binding
+ * -----------------------------------------------------------
+ */
function dayBind(days) {
@@ -2384,8 +2487,12 @@ function BasicView(element, calendar, viewName) {
function dayClick(ev) {
- if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick
- var index = parseInt(this.className.match(/fc\-day(\d+)/)[1]); // TODO: maybe use .data
+ if (!opt('selectable')) { // if selectable, SelectionManager will
+ // worry about dayClick
+ var index = parseInt(this.className.match(/fc\-day(\d+)/)[1]); // TODO:
+ // maybe
+ // use
+ // .data
var date = indexDate(index);
trigger('dayClick', this, date, true, ev);
}
@@ -2393,11 +2500,15 @@ function BasicView(element, calendar, viewName) {
- /* Semi-transparent Overlay Helpers
- ------------------------------------------------------*/
+ /*
+ * Semi-transparent Overlay Helpers
+ * ------------------------------------------------------
+ */
- function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid) { // overlayEnd is exclusive
+ function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid) { // overlayEnd
+ // is
+ // exclusive
if (refreshCoordinateGrid) {
coordinateGrid.build();
}
@@ -2425,15 +2536,18 @@ function BasicView(element, calendar, viewName) {
}
- function renderCellOverlay(row0, col0, row1, col1) { // row1,col1 is inclusive
+ function renderCellOverlay(row0, col0, row1, col1) { // row1,col1 is
+ // inclusive
var rect = coordinateGrid.rect(row0, col0, row1, col1, element);
return renderOverlay(rect, element);
}
- /* Selection
- -----------------------------------------------------------------------*/
+ /*
+ * Selection
+ * -----------------------------------------------------------------------
+ */
function defaultSelectionEnd(startDate, allDay) {
@@ -2442,7 +2556,9 @@ function BasicView(element, calendar, viewName) {
function renderSelection(startDate, endDate, allDay) {
- renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true); // rebuild every time???
+ renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true); // rebuild
+ // every
+ // time???
}
@@ -2459,8 +2575,10 @@ function BasicView(element, calendar, viewName) {
- /* External Dragging
- -----------------------------------------------------------------------*/
+ /*
+ * External Dragging
+ * -----------------------------------------------------------------------
+ */
function dragStart(_dragElement, ev, ui) {
@@ -2484,8 +2602,9 @@ function BasicView(element, calendar, viewName) {
- /* Utilities
- --------------------------------------------------------*/
+ /*
+ * Utilities --------------------------------------------------------
+ */
function defaultEventEnd(event) {
@@ -2601,7 +2720,7 @@ function BasicEventRenderer() {
DayEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
- //var setOverflowHidden = t.setOverflowHidden;
+ // var setOverflowHidden = t.setOverflowHidden;
var isEventDraggable = t.isEventDraggable;
var isEventResizable = t.isEventResizable;
var reportEvents = t.reportEvents;
@@ -2621,8 +2740,10 @@ function BasicEventRenderer() {
- /* Rendering
- --------------------------------------------------------------------*/
+ /*
+ * Rendering
+ * --------------------------------------------------------------------
+ */
function renderEvents(events, modifiedEventId) {
@@ -2673,13 +2794,16 @@ function BasicEventRenderer() {
resizableDayEvent(event, eventElement, seg);
}
eventElementHandlers(event, eventElement);
- // needs to be after, because resizableDayEvent might stopImmediatePropagation on click
+ // needs to be after, because resizableDayEvent might
+ // stopImmediatePropagation on click
}
- /* Dragging
- ----------------------------------------------------------------------------*/
+ /*
+ * Dragging
+ * ----------------------------------------------------------------------------
+ */
function draggableDayEvent(event, eventElement) {
@@ -2697,14 +2821,14 @@ function BasicEventRenderer() {
eventElement.draggable('option', 'revert', !cell || !rowDelta && !colDelta);
clearOverlays();
if (cell) {
- //setOverflowHidden(true);
+ // setOverflowHidden(true);
dayDelta = rowDelta*7 + colDelta * (opt('isRTL') ? -1 : 1);
renderDayOverlay(
addDays(cloneDate(event.start), dayDelta),
addDays(exclEndDay(event), dayDelta)
);
}else{
- //setOverflowHidden(false);
+ // setOverflowHidden(false);
dayDelta = 0;
}
}, ev, 'drag');
@@ -2716,10 +2840,11 @@ function BasicEventRenderer() {
if (dayDelta) {
eventDrop(this, event, dayDelta, 0, event.allDay, ev, ui);
}else{
- eventElement.css('filter', ''); // clear IE opacity side-effects
+ eventElement.css('filter', ''); // clear IE opacity
+ // side-effects
showEvents(event, eventElement);
}
- //setOverflowHidden(false);
+ // setOverflowHidden(false);
}
});
}
@@ -2934,8 +3059,10 @@ function AgendaView(element, calendar, viewName) {
- /* Rendering
- -----------------------------------------------------------------------------*/
+ /*
+ * Rendering
+ * -----------------------------------------------------------------------------
+ */
disableTextSelection(element.addClass('fc-agenda'));
@@ -2989,7 +3116,10 @@ function AgendaView(element, calendar, viewName) {
"<th class='fc-agenda-axis " + headerClass + "'>&nbsp;</th>";
for (i=0; i<colCnt; i++) {
s +=
- "<th class='fc- fc-col" + i + ' ' + headerClass + "'/>"; // fc- needed for setDayID
+ "<th class='fc- fc-col" + i + ' ' + headerClass + "'/>"; // fc-
+ // needed
+ // for
+ // setDayID
}
s +=
"<th class='fc-agenda-gutter " + headerClass + "'>&nbsp;</th>" +
@@ -3000,7 +3130,10 @@ function AgendaView(element, calendar, viewName) {
"<th class='fc-agenda-axis " + headerClass + "'>&nbsp;</th>";
for (i=0; i<colCnt; i++) {
s +=
- "<td class='fc- fc-col" + i + ' ' + contentClass + "'>" + // fc- needed for setDayID
+ "<td class='fc- fc-col" + i + ' ' + contentClass + "'>" + // fc-
+ // needed
+ // for
+ // setDayID
"<div>" +
"<div class='fc-day-content'>" +
"<div style='position:relative'>&nbsp;</div>" +
@@ -3147,7 +3280,8 @@ function AgendaView(element, calendar, viewName) {
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
+ slotTable.height() + allDayHeight + 1 // when no scrollbars. +1
+ // for bottom border
);
dayBodyFirstCellStretcher
@@ -3180,8 +3314,10 @@ function AgendaView(element, calendar, viewName) {
axisWidth
);
- var slotTableWidth = slotScroller[0].clientWidth; // needs to be done after axisWidth (for IE7)
- //slotTable.width(slotTableWidth);
+ var slotTableWidth = slotScroller[0].clientWidth; // needs to be done
+ // after axisWidth
+ // (for IE7)
+ // slotTable.width(slotTableWidth);
gutterWidth = slotScroller.width() - slotTableWidth;
if (gutterWidth) {
@@ -3212,7 +3348,8 @@ function AgendaView(element, calendar, viewName) {
slotScroller.scrollTop(top);
}
scroll();
- setTimeout(scroll, 0); // overrides any previous scroll state made by the browser
+ setTimeout(scroll, 0); // overrides any previous scroll state made by
+ // the browser
}
@@ -3227,8 +3364,10 @@ function AgendaView(element, calendar, viewName) {
- /* Slot/Day clicking and binding
- -----------------------------------------------------------------------*/
+ /*
+ * Slot/Day clicking and binding
+ * -----------------------------------------------------------------------
+ */
function dayBind(cells) {
@@ -3244,10 +3383,14 @@ function AgendaView(element, calendar, viewName) {
function slotClick(ev) {
- if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick
+ if (!opt('selectable')) { // if selectable, SelectionManager will
+ // worry about dayClick
var col = Math.min(colCnt-1, Math.floor((ev.pageX - dayTable.offset().left - axisWidth) / colWidth));
var date = colDate(col);
- var rowMatch = this.parentNode.className.match(/fc-slot(\d+)/); // TODO: maybe use data
+ var rowMatch = this.parentNode.className.match(/fc-slot(\d+)/); // TODO:
+ // maybe
+ // use
+ // data
if (rowMatch) {
var mins = parseInt(rowMatch[1]) * opt('slotMinutes');
var hours = Math.floor(mins/60);
@@ -3262,11 +3405,15 @@ function AgendaView(element, calendar, viewName) {
- /* Semi-transparent Overlay Helpers
- -----------------------------------------------------*/
+ /*
+ * Semi-transparent Overlay Helpers
+ * -----------------------------------------------------
+ */
- function renderDayOverlay(startDate, endDate, refreshCoordinateGrid) { // endDate is exclusive
+ function renderDayOverlay(startDate, endDate, refreshCoordinateGrid) { // endDate
+ // is
+ // exclusive
if (refreshCoordinateGrid) {
coordinateGrid.build();
}
@@ -3303,7 +3450,12 @@ function AgendaView(element, calendar, viewName) {
var stretchEnd = new Date(Math.min(dayEnd, overlayEnd));
if (stretchStart < stretchEnd) {
var col = i*dis+dit;
- var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only use it for horizontal coords
+ var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only
+ // use
+ // it
+ // for
+ // horizontal
+ // coords
var top = timePosition(dayStart, stretchStart);
var bottom = timePosition(dayStart, stretchEnd);
rect.top = top;
@@ -3319,8 +3471,10 @@ function AgendaView(element, calendar, viewName) {
- /* Coordinate Utilities
- -----------------------------------------------------------------------------*/
+ /*
+ * Coordinate Utilities
+ * -----------------------------------------------------------------------------
+ */
coordinateGrid = new CoordinateGrid(function(rows, cols) {
@@ -3413,8 +3567,10 @@ function AgendaView(element, calendar, viewName) {
- // get the Y coordinate of the given time on the given day (both Date objects)
- function timePosition(day, time) { // both date objects. day holds 00:00 of current day
+ // get the Y coordinate of the given time on the given day (both Date
+ // objects)
+ function timePosition(day, time) { // both date objects. day holds 00:00 of
+ // current day
day = cloneDate(day, true);
if (time < addMinutes(cloneDate(day), minMinute)) {
return 0;
@@ -3427,7 +3583,11 @@ function AgendaView(element, calendar, viewName) {
slotI = Math.floor(minutes / slotMinutes),
slotTop = slotTopCache[slotI];
if (slotTop === undefined) {
- slotTop = slotTopCache[slotI] = slotTable.find('tr:eq(' + slotI + ') td div')[0].offsetTop; //.position().top; // need this optimization???
+ slotTop = slotTopCache[slotI] = slotTable.find('tr:eq(' + slotI + ') td div')[0].offsetTop; // .position().top;
+ // //
+ // need
+ // this
+ // optimization???
}
return Math.max(0, Math.round(
slotTop - 1 + slotHeight * ((minutes % slotMinutes) / slotMinutes)
@@ -3458,8 +3618,10 @@ function AgendaView(element, calendar, viewName) {
- /* Selection
- ---------------------------------------------------------------------------------*/
+ /*
+ * Selection
+ * ---------------------------------------------------------------------------------
+ */
function defaultSelectionEnd(startDate, allDay) {
@@ -3486,11 +3648,16 @@ function AgendaView(element, calendar, viewName) {
coordinateGrid.build();
if (helperOption) {
var col = dayDiff(startDate, t.visStart) * dis + dit;
- if (col >= 0 && col < colCnt) { // only works when times are on same day
- var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only for horizontal coords
+ if (col >= 0 && col < colCnt) { // only works when times are on same
+ // day
+ var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only
+ // for
+ // horizontal
+ // coords
var top = timePosition(startDate, startDate);
var bottom = timePosition(startDate, endDate);
- if (bottom > top) { // protect against selections that are entirely before or after visible range
+ if (bottom > top) { // protect against selections that are
+ // entirely before or after visible range
rect.top = top;
rect.height = bottom - top;
rect.left += 2;
@@ -3522,7 +3689,11 @@ function AgendaView(element, calendar, viewName) {
if (selectionHelper) {
slotBind(selectionHelper);
slotContent.append(selectionHelper);
- setOuterWidth(selectionHelper, rect.width, true); // needs to be after appended
+ setOuterWidth(selectionHelper, rect.width, true); // needs
+ // to
+ // be
+ // after
+ // appended
setOuterHeight(selectionHelper, rect.height, true);
}
}
@@ -3543,7 +3714,8 @@ function AgendaView(element, calendar, viewName) {
function slotSelectionMousedown(ev) {
- if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left mouse button
+ if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left
+ // mouse button
unselect(ev);
var dates;
hoverListener.start(function(cell, origCell) {
@@ -3581,8 +3753,10 @@ function AgendaView(element, calendar, viewName) {
- /* External Dragging
- --------------------------------------------------------------------------------*/
+ /*
+ * External Dragging
+ * --------------------------------------------------------------------------------
+ */
function dragStart(_dragElement, ev, ui) {
@@ -3628,7 +3802,7 @@ function AgendaEventRenderer() {
DayEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
- //var setOverflowHidden = t.setOverflowHidden;
+ // var setOverflowHidden = t.setOverflowHidden;
var isEventDraggable = t.isEventDraggable;
var isEventResizable = t.isEventResizable;
var eventEnd = t.eventEnd;
@@ -3645,7 +3819,8 @@ function AgendaEventRenderer() {
var colContentLeft = t.colContentLeft;
var colContentRight = t.colContentRight;
var renderDaySegs = t.renderDaySegs;
- var resizableDayEvent = t.resizableDayEvent; // TODO: streamline binding architecture
+ var resizableDayEvent = t.resizableDayEvent; // TODO: streamline binding
+ // architecture
var getColCnt = t.getColCnt;
var getColWidth = t.getColWidth;
var getSlotHeight = t.getSlotHeight;
@@ -3663,8 +3838,10 @@ function AgendaEventRenderer() {
- /* Rendering
- ----------------------------------------------------------------------------*/
+ /*
+ * Rendering
+ * ----------------------------------------------------------------------------
+ */
function renderEvents(events, modifiedEventId) {
@@ -3794,20 +3971,30 @@ function AgendaEventRenderer() {
forward = seg.forward || 0;
leftmost = colContentLeft(colI*dis + dit);
availWidth = colContentRight(colI*dis + dit) - leftmost;
- availWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS
+ availWidth = Math.min(availWidth-6, availWidth*.95); // TODO:
+ // move this
+ // to CSS
if (levelI) {
// indented and thin
outerWidth = availWidth / (levelI + forward + 1);
}else{
if (forward) {
// moderately wide, aligned left still
- outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =
+ outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12
+ // is
+ // the
+ // predicted
+ // width
+ // of
+ // resizer
+ // =
}else{
// can be entire width, aligned left
outerWidth = availWidth;
}
}
- left = leftmost + // leftmost possible
+ left = leftmost + // leftmost
+ // possible
(availWidth / (levelI + forward + 1) * levelI) // indentation
* dis + (rtl ? availWidth - outerWidth : 0); // rtl
seg.top = top;
@@ -3819,7 +4006,8 @@ function AgendaEventRenderer() {
slotSegmentContainer[0].innerHTML = html; // faster than html()
eventElements = slotSegmentContainer.children();
- // retrieve elements, run through eventRender callback, bind event handlers
+ // retrieve elements, run through eventRender callback, bind event
+ // handlers
for (i=0; i<segCnt; i++) {
seg = segs[i];
event = seg.event;
@@ -3946,7 +4134,8 @@ function AgendaEventRenderer() {
resizableDayEvent(event, eventElement, seg);
}
eventElementHandlers(event, eventElement);
- // needs to be after, because resizableDayEvent might stopImmediatePropagation on click
+ // needs to be after, because resizableDayEvent might
+ // stopImmediatePropagation on click
}
@@ -3963,8 +4152,10 @@ function AgendaEventRenderer() {
- /* Dragging
- -----------------------------------------------------------------------------------*/
+ /*
+ * Dragging
+ * -----------------------------------------------------------------------------------
+ */
// when event starts out FULL-DAY
@@ -3981,7 +4172,8 @@ function AgendaEventRenderer() {
var minMinute = getMinMinute();
eventElement.draggable({
zIndex: 9,
- opacity: opt('dragOpacity', 'month'), // use whatever the month view was using
+ opacity: opt('dragOpacity', 'month'), // use whatever the month
+ // view was using
revertDuration: opt('dragRevertDuration'),
start: function(ev, ui) {
trigger('eventDragStart', eventElement, event, ev, ui);
@@ -3990,7 +4182,7 @@ function AgendaEventRenderer() {
hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
clearOverlays();
if (cell) {
- //setOverflowHidden(true);
+ // setOverflowHidden(true);
revert = false;
dayDelta = colDelta * dis;
if (!cell.row) {
@@ -4005,7 +4197,10 @@ function AgendaEventRenderer() {
if (isStart) {
if (allDay) {
// convert event to temporary slot-event
- eventElement.width(colWidth - 10); // don't use entire width
+ eventElement.width(colWidth - 10); // don't
+ // use
+ // entire
+ // width
setOuterHeight(
eventElement,
slotHeight * Math.round(
@@ -4023,7 +4218,7 @@ function AgendaEventRenderer() {
revert = revert || (allDay && !dayDelta);
}else{
resetElement();
- //setOverflowHidden(false);
+ // setOverflowHidden(false);
revert = true;
}
eventElement.draggable('option', 'revert', revert);
@@ -4034,9 +4229,11 @@ function AgendaEventRenderer() {
clearOverlays();
trigger('eventDragStop', eventElement, event, ev, ui);
if (revert) {
- // hasn't moved or is out of bounds (draggable has already reverted)
+ // hasn't moved or is out of bounds (draggable has already
+ // reverted)
resetElement();
- eventElement.css('filter', ''); // clear IE opacity side-effects
+ eventElement.css('filter', ''); // clear IE opacity
+ // side-effects
showEvents(event, eventElement);
}else{
// changed!
@@ -4049,7 +4246,7 @@ function AgendaEventRenderer() {
}
eventDrop(this, event, dayDelta, minuteDelta, allDay, ev, ui);
}
- //setOverflowHidden(false);
+ // setOverflowHidden(false);
}
});
function resetElement() {
@@ -4130,10 +4327,14 @@ function AgendaEventRenderer() {
// changed!
eventDrop(this, event, dayDelta, allDay ? 0 : minuteDelta, allDay, ev, ui);
}else{
- // either no change or out-of-bounds (draggable has already reverted)
+ // either no change or out-of-bounds (draggable has already
+ // reverted)
resetElement();
- eventElement.css('filter', ''); // clear IE opacity side-effects
- eventElement.css(origPosition); // sometimes fast drags make event revert to wrong position
+ eventElement.css('filter', ''); // clear IE opacity
+ // side-effects
+ eventElement.css(origPosition); // sometimes fast drags make
+ // event revert to wrong
+ // position
updateTimeText(0);
showEvents(event, eventElement);
}
@@ -4150,7 +4351,8 @@ function AgendaEventRenderer() {
function resetElement() {
// convert back to original slot-event
if (allDay) {
- timeElement.css('display', ''); // show() was causing display=inline
+ timeElement.css('display', ''); // show() was causing
+ // display=inline
eventElement.draggable('option', 'grid', [colWidth, slotHeight]);
allDay = false;
}
@@ -4159,8 +4361,10 @@ function AgendaEventRenderer() {
- /* Resizing
- --------------------------------------------------------------------------------------*/
+ /*
+ * Resizing
+ * --------------------------------------------------------------------------------------
+ */
function resizableSlotEvent(event, eventElement, timeElement) {
@@ -4184,7 +4388,9 @@ function AgendaEventRenderer() {
timeElement.text(
formatDates(
event.start,
- (!slotDelta && !event.end) ? null : // no change, so don't display time range
+ (!slotDelta && !event.end) ? null : // no change, so
+ // don't display
+ // time range
addMinutes(eventEnd(event), opt('slotMinutes')*slotDelta),
opt('timeFormat')
)
@@ -4199,7 +4405,8 @@ function AgendaEventRenderer() {
}else{
eventElement.css('z-index', 8);
showEvents(event, eventElement);
- // BUG: if event was really short, need to put title back in span
+ // BUG: if event was really short, need to put title back in
+ // span
}
}
});
@@ -4238,7 +4445,7 @@ function View(element, calendar, viewName) {
t.name = viewName;
t.opt = opt;
t.trigger = trigger;
- //t.setOverflowHidden = setOverflowHidden;
+ // t.setOverflowHidden = setOverflowHidden;
t.isEventDraggable = isEventDraggable;
t.isEventResizable = isEventResizable;
t.reportEvents = reportEvents;
@@ -4287,10 +4494,9 @@ function View(element, calendar, viewName) {
/*
- function setOverflowHidden(bool) {
- element.css('overflow', bool ? 'hidden' : '');
- }
- */
+ * function setOverflowHidden(bool) { element.css('overflow', bool ?
+ * 'hidden' : ''); }
+ */
function isEventDraggable(event) {
@@ -4298,7 +4504,8 @@ function View(element, calendar, viewName) {
}
- function isEventResizable(event) { // but also need to make sure the seg.isEnd == true
+ function isEventResizable(event) { // but also need to make sure the
+ // seg.isEnd == true
return isEventEditable(event) && !opt('disableResizing');
}
@@ -4309,12 +4516,15 @@ function View(element, calendar, viewName) {
- /* Event Data
- ------------------------------------------------------------------------------*/
+ /*
+ * Event Data
+ * ------------------------------------------------------------------------------
+ */
// report when view receives new events
- function reportEvents(events) { // events are already normalized at this point
+ function reportEvents(events) { // events are already normalized at this
+ // point
eventsByID = {};
var i, len=events.length, event;
for (i=0; i<len; i++) {
@@ -4335,8 +4545,10 @@ function View(element, calendar, viewName) {
- /* Event Elements
- ------------------------------------------------------------------------------*/
+ /*
+ * Event Elements
+ * ------------------------------------------------------------------------------
+ */
// report when view creates an element for an event
@@ -4355,7 +4567,6 @@ function View(element, calendar, viewName) {
eventElementsByID = {};
}
-
// attaches eventClick, eventMouseover, eventMouseout
function eventElementHandlers(event, eventElement) {
eventElement
@@ -4365,15 +4576,19 @@ function View(element, calendar, viewName) {
return trigger('eventClick', this, event, ev);
}
})
- .hover(
- function(ev) {
+ // dblclick hack
+ .dblclick(function (ev) {
+ trigger('dblclick', this, event, ev);
+ })
+ .hover(function(ev) {
trigger('eventMouseover', this, event, ev);
},
function(ev) {
trigger('eventMouseout', this, event, ev);
}
);
- // TODO: don't fire eventMouseover/eventMouseout *while* dragging is occuring (on subject element)
+ // TODO: don't fire eventMouseover/eventMouseout *while* dragging is
+ // occuring (on subject element)
// TODO: same for resizing
}
@@ -4400,8 +4615,10 @@ function View(element, calendar, viewName) {
- /* Event Modification Reporting
- ---------------------------------------------------------------------------------*/
+ /*
+ * Event Modification Reporting
+ * ---------------------------------------------------------------------------------
+ */
function eventDrop(e, event, dayDelta, minuteDelta, allDay, ev, ui) {
@@ -4416,7 +4633,8 @@ function View(element, calendar, viewName) {
minuteDelta,
allDay,
function() {
- // TODO: investigate cases where this inverse technique might not work
+ // TODO: investigate cases where this inverse technique might
+ // not work
moveEvents(eventsByID[eventId], -dayDelta, -minuteDelta, oldAllDay);
reportEventChange(eventId);
},
@@ -4437,7 +4655,8 @@ function View(element, calendar, viewName) {
dayDelta,
minuteDelta,
function() {
- // TODO: investigate cases where this inverse technique might not work
+ // TODO: investigate cases where this inverse technique might
+ // not work
elongateEvents(eventsByID[eventId], -dayDelta, -minuteDelta);
reportEventChange(eventId);
},
@@ -4449,8 +4668,10 @@ function View(element, calendar, viewName) {
- /* Event Modification Math
- ---------------------------------------------------------------------------------*/
+ /*
+ * Event Modification Math
+ * ---------------------------------------------------------------------------------
+ */
function moveEvents(events, dayDelta, minuteDelta, allDay) {
@@ -4511,7 +4732,7 @@ function DayEventRenderer() {
var dateCell = t.dateCell;
var compileDaySegs = t.compileDaySegs;
var getDaySegmentContainer = t.getDaySegmentContainer;
- var bindDaySeg = t.bindDaySeg; //TODO: streamline this
+ var bindDaySeg = t.bindDaySeg; // TODO: streamline this
var formatDates = t.calendar.formatDates;
var renderDayOverlay = t.renderDayOverlay;
var clearOverlays = t.clearOverlays;
@@ -4519,8 +4740,10 @@ function DayEventRenderer() {
- /* Rendering
- -----------------------------------------------------------------------------*/
+ /*
+ * Rendering
+ * -----------------------------------------------------------------------------
+ */
function renderDaySegs(segs, modifiedEventId) {
@@ -4537,7 +4760,8 @@ function DayEventRenderer() {
var seg;
var top;
var k;
- segmentContainer[0].innerHTML = daySegHTML(segs); // faster than .html()
+ segmentContainer[0].innerHTML = daySegHTML(segs); // faster than
+ // .html()
daySegElementResolve(segs, segmentContainer.children());
daySegElementReport(segs);
daySegHandlers(segs, segmentContainer, modifiedEventId);
@@ -4676,7 +4900,8 @@ function DayEventRenderer() {
if (seg.isEnd && isEventResizable(event)) {
html +=
"<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'>" +
- "&nbsp;&nbsp;&nbsp;" + // makes hit area a lot better for IE6/7
+ "&nbsp;&nbsp;&nbsp;" + // makes hit area a lot better for
+ // IE6/7
"</div>";
}
html +=
@@ -4836,7 +5061,10 @@ function DayEventRenderer() {
var rowCnt = rowDivs.length;
var tops = [];
for (i=0; i<rowCnt; i++) {
- tops[i] = rowDivs[i][0].offsetTop; // !!?? but this means the element needs position:relative if in a table cell!!!!
+ tops[i] = rowDivs[i][0].offsetTop; // !!?? but this means the
+ // element needs
+ // position:relative if in a
+ // table cell!!!!
}
return tops;
}
@@ -4861,8 +5089,10 @@ function DayEventRenderer() {
- /* Resizing
- -----------------------------------------------------------------------------------*/
+ /*
+ * Resizing
+ * -----------------------------------------------------------------------------------
+ */
function resizableDayEvent(event, element, seg) {
@@ -4874,14 +5104,20 @@ function DayEventRenderer() {
// TODO: look into using jquery-ui mouse widget for this stuff
disableTextSelection(element); // prevent native <a> selection for IE
element
- .mousedown(function(ev) { // prevent native <a> selection for others
+ .mousedown(function(ev) { // prevent native <a> selection for
+ // others
ev.preventDefault();
})
.click(function(ev) {
if (isResizing) {
- ev.preventDefault(); // prevent link from being visited (only method that worked in IE6)
- ev.stopImmediatePropagation(); // prevent fullcalendar eventClick handler from being called
- // (eventElementHandlers needs to be bound after resizableDayEvent)
+ ev.preventDefault(); // prevent link from being visited
+ // (only method that worked in IE6)
+ ev.stopImmediatePropagation(); // prevent fullcalendar
+ // eventClick handler from
+ // being called
+ // (eventElementHandlers
+ // needs to be bound after
+ // resizableDayEvent)
}
});
@@ -4938,7 +5174,12 @@ function DayEventRenderer() {
}
}
clearOverlays();
- renderDayOverlay(event.start, addDays(cloneDate(newEnd), 1)); // coordinate grid already rebuild at hoverListener.start
+ renderDayOverlay(event.start, addDays(cloneDate(newEnd), 1)); // coordinate
+ // grid
+ // already
+ // rebuild
+ // at
+ // hoverListener.start
}
}, ev);
@@ -4953,7 +5194,8 @@ function DayEventRenderer() {
}
// otherwise, the drag handler already restored the old events
- setTimeout(function() { // make this happen after the element's click event
+ setTimeout(function() { // make this happen after the element's
+ // click event
isResizing = false;
},0);
}
@@ -4964,7 +5206,7 @@ function DayEventRenderer() {
}
-//BUG: unselect needs to be triggered when events are dragged+dropped
+// BUG: unselect needs to be triggered when events are dragged+dropped
function SelectionManager() {
var t = this;
@@ -4995,7 +5237,9 @@ function SelectionManager() {
$(document).mousedown(function(ev) {
var ignore = opt('unselectCancel');
if (ignore) {
- if ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match
+ if ($(ev.target).parents(ignore).length) { // could be
+ // optimized to stop
+ // after first match
return;
}
}
@@ -5029,16 +5273,21 @@ function SelectionManager() {
}
- function daySelectionMousedown(ev) { // not really a generic manager method, oh well
+ function daySelectionMousedown(ev) { // not really a generic manager
+ // method, oh well
var cellDate = t.cellDate;
var cellIsAllDay = t.cellIsAllDay;
var hoverListener = t.getHoverListener();
- var reportDayClick = t.reportDayClick; // this is hacky and sort of weird
- if (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button
+ var reportDayClick = t.reportDayClick; // this is hacky and sort of
+ // weird
+ if (ev.which == 1 && opt('selectable')) { // which==1 means left mouse
+ // button
unselect(ev);
var _mousedownElement = this;
var dates;
- hoverListener.start(function(cell, origCell) { // TODO: maybe put cellDate/cellIsAllDay info in cell
+ hoverListener.start(function(cell, origCell) { // TODO: maybe put
+ // cellDate/cellIsAllDay
+ // info in cell
clearSelection();
if (cell && cellIsAllDay(cell)) {
dates = [ cellDate(origCell), cellDate(cell) ].sort(cmp);
@@ -5133,7 +5382,8 @@ function CoordinateGrid(buildFunc) {
};
- t.rect = function(row0, col0, row1, col1, originElement) { // row1,col1 is inclusive
+ t.rect = function(row0, col0, row1, col1, originElement) { // row1,col1 is
+ // inclusive
var origin = originElement.offset();
return {
top: rows[row0][0] - origin.top,