diff --git a/dist/fullcalendar.js b/dist/fullcalendar.js index fffe300..1f1a0a4 100644 --- a/dist/fullcalendar.js +++ b/dist/fullcalendar.js @@ -6833,10 +6833,16 @@ function ResourceEventRenderer() { function eventsForResource(resource, events) { var resourceEvents = []; + var hasResource = function(event) { + return event.resources && $.grep(event.resources, function(id) { + return id == resource.id; + }).length; + }; + for (var i = 0; i < events.length; i++) { - if (events[i].resources && $.grep(events[i].resources, function(id) { return id == resource.id; }).length) { - resourceEvents.push(events[i]); - } + if (hasResource(events[i])) { + resourceEvents.push(events[i]); + } } return resourceEvents; } @@ -8119,13 +8125,19 @@ function DayEventRenderer() { function eventsForResource(resource, events) { var resourceEvents = []; + var hasResource = function(event) { + return event.resources && $.grep(event.resources, function(id) { + return id == resource.id; + }).length; + }; + for (var i = 0; i < events.length; i++) { - if (events[i].resources && $.grep(events[i].resources, function(id) { return id == resource.id; }).length) { - resourceEvents.push(events[i]); - } - } - return resourceEvents; - } + if (hasResource(events[i])) { + resourceEvents.push(events[i]); + } + } + return resourceEvents; + } // Generate an array of segments for a single event. // A "segment" is the same data structure that View.rangeToSegments produces, diff --git a/dist/fullcalendar.min.js b/dist/fullcalendar.min.js index 9fc02c2..522b234 100644 --- a/dist/fullcalendar.min.js +++ b/dist/fullcalendar.min.js @@ -4,5 +4,5 @@ * (c) 2014 Adam Shaw, Sean Kenny */ (function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):t(jQuery,moment)})(function(t,e){function n(t,e){return e.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")}function r(t,e){var n=e.longDateFormat("L");return n=n.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),t.isRTL?n+=" ddd":n="ddd "+n,n}function a(t){o(He,t)}function o(e){function n(n,r){t.isPlainObject(r)&&t.isPlainObject(e[n])&&!i(n)?e[n]=o({},e[n],r):void 0!==r&&(e[n]=r)}for(var r=1;arguments.length>r;r++)t.each(arguments[r],n);return e}function i(t){return/(Time|Duration)$/.test(t)}function s(n,r){function a(t){le?v()&&(D(),y(t)):i()}function i(){ce=re.theme?"ui":"fc",n.addClass("fc"),re.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),re.theme&&n.addClass("ui-widget"),le=t("
").prependTo(n),ie=new l(ee,re),se=ie.render(),se&&n.prepend(se),p(re.defaultView),re.handleWindowResize&&t(window).resize(T),h()||s()}function s(){setTimeout(function(){!de.start&&h()&&m()},0)}function d(){de&&(J("viewDestroy",de,de,de.element),de.triggerEventDestroy()),t(window).unbind("resize",T),re.droppable&&t(document).off("dragstart",K).off("dragstop",te),de.selectionManagerDestroy&&de.selectionManagerDestroy(),ie.destroy(),le.remove(),n.removeClass("fc fc-ltr fc-rtl ui-widget")}function v(){return n.is(":visible")}function h(){return t("body").is(":visible")}function p(t){de&&t==de.name||g(t)}function g(e){be++,de&&(J("viewDestroy",de,de,de.element),A(),de.triggerEventDestroy(),X(),de.element.remove(),ie.deactivateButton(de.name)),ie.activateButton(e),de=new Oe[e](t("").appendTo(le),ee),m(),V(),be--}function m(t){de.start&&!t&&ve.isWithin(de.intervalStart,de.intervalEnd)||v()&&y(t)}function y(t){be++,de.start&&(J("viewDestroy",de,de,de.element),A(),M()),X(),t&&(ve=de.incrementDate(ve,t)),de.render(ve.clone()),w(),V(),(de.afterRender||k)(),N(),F(),J("viewRender",de,de,de.element),be--,R()}function b(){v()&&(A(),M(),D(),w(),x())}function D(){fe=re.contentHeight?re.contentHeight:re.height?re.height-(se?se.height():0)-C(le):Math.round(le.width()/Math.max(re.aspectRatio,.5))}function w(){void 0===fe&&D(),be++,de.setHeight(fe),de.setWidth(le.width()),be--,ue=n.outerWidth()}function T(t){if(!be&&t.target===window)if(de.start){var e=++ye;setTimeout(function(){e==ye&&!be&&v()&&ue!=(ue=n.outerWidth())&&(be++,b(),de.trigger("windowResize",me),be--)},re.windowResizeDelay)}else s()}function E(){M(),z()}function S(t){M(),x(t)}function x(t){v()&&(de.renderEvents(De,t),de.trigger("eventAfterAllRender"))}function M(){de.triggerEventDestroy(),de.clearEvents(),de.clearEventData()}function R(){!re.lazyFetching||pe(de.start,de.end)?z():x()}function z(){ge(de.start,de.end)}function H(t){De=t,x()}function _(t){S(t)}function N(){ie.updateTitle(de.title)}function F(){var t=ee.getNow();t.isWithin(de.intervalStart,de.intervalEnd)?ie.disableButton("today"):ie.enableButton("today")}function O(t,e){de.select(t,e)}function A(){de&&de.unselect()}function W(){m(-1)}function Y(){m(1)}function L(){ve.add("years",-1),m()}function Z(){ve.add("years",1),m()}function B(){ve=ee.getNow(),m()}function j(t){ve=ee.moment(t),m()}function I(t){ve.add(e.duration(t)),m()}function $(){return ve.clone()}function X(){le.css({width:"100%",height:le.height(),overflow:"hidden"})}function V(){le.css({width:"",height:"",overflow:""})}function G(){return ee}function U(){return de}function Q(t,e){return void 0===e?re[t]:(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(re[t]=e,b()),void 0)}function J(t,e){return re[t]?re[t].apply(e||me,Array.prototype.slice.call(arguments,2)):void 0}function K(e,n){var r=e.target,a=t(r);if(!a.parents(".fc").length){var o=re.dropAccept;(t.isFunction(o)?o.call(r,a):a.is(o))&&(he=r,de.dragStart(he,e,n))}}function te(t,e){he&&(de.dragStop(he,t,e),he=null)}var ee=this;r=r||{};var ne,re=o({},He,r);ne=re.lang in _e?_e[re.lang]:_e[He.lang],ne&&(re=o({},He,ne,r)),re.isRTL&&(re=o({},He,Ne,ne||{},r)),ee.options=re,ee.render=a,ee.destroy=d,ee.refetchEvents=E,ee.reportEvents=H,ee.reportEventChange=_,ee.rerenderEvents=S,ee.changeView=p,ee.select=O,ee.unselect=A,ee.prev=W,ee.next=Y,ee.prevYear=L,ee.nextYear=Z,ee.today=B,ee.gotoDate=j,ee.incrementDate=I,ee.getDate=$,ee.getCalendar=G,ee.getView=U,ee.option=Q,ee.trigger=J;var ae=f(e.localeData(re.lang));if(re.monthNames&&(ae._months=re.monthNames),re.monthNamesShort&&(ae._monthsShort=re.monthNamesShort),re.dayNames&&(ae._weekdays=re.dayNames),re.dayNamesShort&&(ae._weekdaysShort=re.dayNamesShort),null!=re.firstDay){var oe=f(ae._week);oe.dow=re.firstDay,ae._week=oe}ee.defaultAllDayEventDuration=e.duration(re.defaultAllDayEventDuration),ee.defaultTimedEventDuration=e.duration(re.defaultTimedEventDuration),ee.moment=function(){var t;return"local"===re.timezone?(t=Fe.moment.apply(null,arguments),t.hasTime()&&t.local()):t="UTC"===re.timezone?Fe.moment.utc.apply(null,arguments):Fe.moment.parseZone.apply(null,arguments),t._lang=ae,t},ee.getIsAmbigTimezone=function(){return"local"!==re.timezone&&"UTC"!==re.timezone},ee.rezoneDate=function(t){return ee.moment(t.toArray())},ee.getNow=function(){var t=re.now;return"function"==typeof t&&(t=t()),ee.moment(t)},ee.calculateWeekNumber=function(t){var e=re.weekNumberCalculation;return"function"==typeof e?e(t):"local"===e?t.week():"ISO"===e.toUpperCase()?t.isoWeek():void 0},ee.getEventEnd=function(t){return t.end?t.end.clone():ee.getDefaultEventEnd(t.allDay,t.start)},ee.getDefaultEventEnd=function(t,e){var n=e.clone();return t?n.stripTime().add(ee.defaultAllDayEventDuration):n.add(ee.defaultTimedEventDuration),ee.getIsAmbigTimezone()&&n.stripZone(),n},ee.formatRange=function(t,e,n){return"function"==typeof n&&(n=n.call(ee,re,ae)),q(t,e,n,null,re.isRTL)},ee.formatDate=function(t,e){return"function"==typeof e&&(e=e.call(ee,re,ae)),P(t,e)},c.call(ee,re),u.call(ee,re);var ie,se,le,ce,de,ue,fe,ve,he,pe=ee.isFetchNeeded,ge=ee.fetchEvents,me=n[0],ye=0,be=0,De=[];ve=null!=re.defaultDate?ee.moment(re.defaultDate):ee.getNow(),re.droppable&&t(document).on("dragstart",K).on("dragstop",te)}function l(e,n){function r(){f=n.theme?"ui":"fc";var e=n.header;return e?v=t("| "+(Le("allDayHTML")||H(Le("allDayText")))+" | "+""+" "+" | "+""+" |
|---|
| "+(d&&i?" ":H(Ue(o,Le("axisFormat"))))+" | "+""+" | "+"
|---|
| "+(Ze("allDayHTML")||H(Ze("allDayText")))+" | "+""+" "+" | "+""+" |
|---|
| "+(d&&i?" ":H(Ue(o,Ze("axisFormat"))))+" | "+""+" | "+"
|---|
| "+(Ze("allDayHTML")||H(Ze("allDayText")))+" | "+""+" "+" | "+""+" |
|---|
| "+(d&&i?" ":H(Ue(o,Ze("axisFormat"))))+" | "+""+" | "+"
|---|