forked from dakala/fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfullcalendar.api.js
More file actions
51 lines (48 loc) · 1.39 KB
/
fullcalendar.api.js
File metadata and controls
51 lines (48 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* FullCalendar plugin implementation.
*/
Drupal.fullcalendar.plugins.awesome = {
/**
* Add in FullCalendar options.
*
* @param fullcalendar
* The fullcalendar object.
*
* @see http://arshaw.com/fullcalendar/docs
*/
options: function (fullcalendar) {
var settings = Drupal.settings.fullcalendar[fullcalendar.dom_id].awesome;
var options = $.extend(
{
theme: false,
minTime: 9,
maxTime: 17
},
settings
);
return options;
},
/**
* Respond to a jQuery UI draggable event being dropped onto the calendar.
*
* @param date
* The JavaScript Date object of where the event was dropped.
* @param allDay
* A Boolean of where the event was dropped, TRUE for an all-day cell, or
* FALSE for a slot with a specific time.
* @param jsEvent
* The primitive JavaScript event, with information like mouse coordinates.
* @param ui
* The jQuery UI information.
* @param object
* The DOM element that has been dropped.
* @param fullcalendar
* The fullcalendar object.
*/
drop: function (date, allDay, jsEvent, ui, object, fullcalendar) {
var eventObject = $.extend({}, $(object).data('eventObject'));
eventObject.start = date;
eventObject.allDay = allDay ? 1 : 0;
fullcalendar.$calendar.find('.fullcalendar').fullCalendar('renderEvent', eventObject, true);
}
};