diff --git a/build/out/fullcalendar.js b/build/out/fullcalendar.js index d87de0a..6758d74 100644 --- a/build/out/fullcalendar.js +++ b/build/out/fullcalendar.js @@ -5261,7 +5261,7 @@ function ResourceView(element, calendar, viewName) { function realCellToDate(cell) { // ugh "real" ... but blame it on our abuse of the "cell" system - var d = cellToDate(0, cell.col); + var d = cellToDate(0, 0); var slotIndex = cell.row; if (opt('allDaySlot')) { slotIndex--; @@ -5337,11 +5337,11 @@ function ResourceView(element, calendar, viewName) { } - function renderSlotSelection(startDate, endDate) { + function renderSlotSelection(startDate, endDate, col) { var helperOption = opt('selectHelper'); coordinateGrid.build(); if (helperOption) { - var col = dateToCell(startDate).col; + col = col || dateToCell(startDate).col; if (col >= 0 && col < colCnt) { // only works when times are on same day var rect = coordinateGrid.rect(0, col, 0, col, slotContainer); // only for horizontal coords var top = timePosition(startDate, startDate); @@ -5401,9 +5401,11 @@ function ResourceView(element, calendar, viewName) { if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left mouse button unselect(ev); var dates; + var col; hoverListener.start(function(cell, origCell) { clearSelection(); if (cell && cell.col == origCell.col && !getIsCellAllDay(cell)) { + col = cell.col; var d1 = realCellToDate(origCell); var d2 = realCellToDate(cell); dates = [ @@ -5412,7 +5414,7 @@ function ResourceView(element, calendar, viewName) { d2, addMinutes(cloneDate(d2), snapMinutes) ].sort(dateCompare); - renderSlotSelection(dates[0], dates[3]); + renderSlotSelection(dates[0], dates[3], cell.col); }else{ dates = null; } @@ -5423,6 +5425,7 @@ function ResourceView(element, calendar, viewName) { if (+dates[0] == +dates[1]) { reportDayClick(dates[0], false, ev); } + ev.data = resources()[col]; reportSelection(dates[0], dates[3], false, ev); } }); diff --git a/build/out/fullcalendar.min.js b/build/out/fullcalendar.min.js index 1db2045..56c80ea 100644 --- a/build/out/fullcalendar.min.js +++ b/build/out/fullcalendar.min.js @@ -4,5 +4,5 @@ * (c) 2013 Adam Shaw, Sean Kenny - resource view */ (function(t,e){function n(e){t.extend(!0,ye,e)}function r(n,r,u){function f(t){se?m()&&(E(),S(t)):d()}function d(){le=r.theme?"ui":"fc",n.addClass("fc"),r.isRTL?n.addClass("fc-rtl"):n.addClass("fc-ltr"),r.theme&&n.addClass("ui-widget"),se=t("
").prependTo(n),oe=new a(ne,r),ie=oe.render(),ie&&n.prepend(ie),b(r.defaultView),r.handleWindowResize&&t(window).resize(H),y()||h()}function h(){setTimeout(function(){!ce.start&&y()&&C()},0)}function g(){ce&&(ee("viewDestroy",ce,ce,ce.element),ce.triggerEventDestroy()),t(window).unbind("resize",H),oe.destroy(),se.remove(),n.removeClass("fc fc-rtl ui-widget")}function m(){return n.is(":visible")}function y(){return t("body").is(":visible")}function b(t){ce&&t==ce.name||M(t)}function M(e){ge++,ce&&(ee("viewDestroy",ce,ce,ce.element),Y(),ce.triggerEventDestroy(),$(),ce.element.remove(),oe.deactivateButton(ce.name)),oe.activateButton(e),ce=new we[e](t("").appendTo(se),ne),C(),Q(),ge--}function C(t){(!ce.start||t||ce.start>pe||pe>=ce.end)&&m()&&S(t)}function S(t){ge++,ce.start&&(ee("viewDestroy",ce,ce,ce.element),Y(),z()),$(),ce.render(pe,t||0),x(),Q(),(ce.afterRender||L)(),q(),j(),ee("viewRender",ce,ce,ce.element),ce.trigger("viewDisplay",ve),ge--,W()}function T(){m()&&(Y(),z(),E(),x(),F())}function E(){fe=r.contentHeight?r.contentHeight:r.height?r.height-(ie?ie.height():0)-N(se):Math.round(se.width()/Math.max(r.aspectRatio,.5))}function x(){fe===e&&E(),ge++,ce.setHeight(fe),ce.setWidth(se.width()),ge--,ue=n.outerWidth()}function H(){if(!ge)if(ce.start){var t=++he;setTimeout(function(){t==he&&!ge&&m()&&ue!=(ue=n.outerWidth())&&(ge++,T(),ce.trigger("windowResize",ve),ge--)},200)}else h()}function R(){z(),O()}function k(t){z(),F(t)}function F(t){m()&&(ce.setEventData(me),ce.renderEvents(me,t),ce.trigger("eventAfterAllRender"))}function z(){ce.triggerEventDestroy(),ce.clearEvents(),ce.clearEventData()}function W(){!r.lazyFetching||re(ce.visStart,ce.visEnd)?O():F()}function O(){ae(ce.visStart,ce.visEnd)}function A(t){me=t,F()}function _(t){k(t)}function q(){oe.updateTitle(ce.title)}function j(){var t=new Date;t>=ce.start&&ce.end>t?oe.disableButton("today"):oe.enableButton("today")}function P(t,n,r){ce.select(t,n,r===e?!0:r)}function Y(){ce&&ce.unselect()}function B(){C(-1)}function I(){C(1)}function X(){s(pe,-1),C()}function J(){s(pe,1),C()}function V(){pe=new Date,C()}function G(t,e,n){t instanceof Date?pe=v(t):p(pe,t,e,n),C()}function U(t,n,r){t!==e&&s(pe,t),n!==e&&l(pe,n),r!==e&&c(pe,r),C()}function Z(){return v(pe)}function $(){se.css({width:"100%",height:se.height(),overflow:"hidden"})}function Q(){se.css({width:"",height:"",overflow:""})}function K(){return ce}function te(t,n){return n===e?r[t]:(("height"==t||"contentHeight"==t||"aspectRatio"==t)&&(r[t]=n,T()),e)}function ee(t,n){return r[t]?r[t].apply(n||ve,Array.prototype.slice.call(arguments,2)):e}var ne=this;ne.options=r,ne.render=f,ne.destroy=g,ne.refetchEvents=R,ne.reportEvents=A,ne.reportEventChange=_,ne.rerenderEvents=k,ne.changeView=b,ne.select=P,ne.unselect=Y,ne.prev=B,ne.next=I,ne.prevYear=X,ne.nextYear=J,ne.today=V,ne.gotoDate=G,ne.incrementDate=U,ne.formatDate=function(t,e){return D(t,e,r)},ne.formatDates=function(t,e,n){return w(t,e,n,r)},ne.getDate=Z,ne.getView=K,ne.option=te,ne.trigger=ee,o.call(ne,r,u);var re=ne.isFetchNeeded,ae=ne.fetchEvents;i.call(ne,r);var oe,ie,se,le,ce,ue,fe,de,ve=n[0],he=0,ge=0,pe=new Date,me=[];p(pe,r.year,r.month,r.date),r.droppable&&t(document).bind("dragstart",function(e,n){var a=e.target,o=t(a);if(!o.parents(".fc").length){var i=r.dropAccept;(t.isFunction(i)?i.call(a,o):o.is(i))&&(de=a,ce.dragStart(de,e,n))}}).bind("dragstop",function(t,e){de&&(ce.dragStop(de,t,e),de=null)})}function a(n,r){function a(){v=r.theme?"ui":"fc";var n=r.header;return n?h=t("| "+Ue("allDayText")+" | "+""+" "+" | "+""+" |
|---|
| "+(u&&i?" ":sn(r,Ue("axisFormat")))+" | "+""+" | "+"
|---|
| "+Ge("allDayText")+" | "+""+" "+" | "+""+" |
|---|
| "+(u&&i?" ":on(r,Ge("axisFormat")))+" | "+""+" | "+"
|---|
| "+Ge("allDayText")+" | "+""+" "+" | "+""+" |
|---|
| "+(u&&i?" ":on(r,Ge("axisFormat")))+" | "+""+" | "+"
|---|