mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-15 12:25:20 +08:00
refactor and simplify the way view switching/rerendering works
This commit is contained in:
+9
-10
@@ -12,10 +12,10 @@ function View(element, calendar, viewName) {
|
||||
t.trigger = trigger;
|
||||
t.isEventDraggable = isEventDraggable;
|
||||
t.isEventResizable = isEventResizable;
|
||||
t.reportEvents = reportEvents;
|
||||
t.setEventData = setEventData;
|
||||
t.clearEventData = clearEventData;
|
||||
t.eventEnd = eventEnd;
|
||||
t.reportEventElement = reportEventElement;
|
||||
t.reportEventClear = reportEventClear;
|
||||
t.eventElementHandlers = eventElementHandlers;
|
||||
t.showEvents = showEvents;
|
||||
t.hideEvents = hideEvents;
|
||||
@@ -95,8 +95,7 @@ function View(element, calendar, viewName) {
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
// report when view receives new events
|
||||
function reportEvents(events) { // events are already normalized at this point
|
||||
function setEventData(events) { // events are already normalized at this point
|
||||
eventsByID = {};
|
||||
var i, len=events.length, event;
|
||||
for (i=0; i<len; i++) {
|
||||
@@ -108,6 +107,12 @@ function View(element, calendar, viewName) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clearEventData() {
|
||||
eventElements = [];
|
||||
eventElementsByID = {};
|
||||
}
|
||||
|
||||
|
||||
// returns a Date object for an event's end
|
||||
@@ -132,12 +137,6 @@ function View(element, calendar, viewName) {
|
||||
}
|
||||
|
||||
|
||||
function reportEventClear() {
|
||||
eventElements = [];
|
||||
eventElementsByID = {};
|
||||
}
|
||||
|
||||
|
||||
// attaches eventClick, eventMouseover, eventMouseout
|
||||
function eventElementHandlers(event, eventElement) {
|
||||
eventElement
|
||||
|
||||
Reference in New Issue
Block a user