My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 327: Default cursor for non-editable no-url events
3 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Aug 2013


Sign in to add a comment
 
Reported by yowza...@gmail.com, Feb 5, 2010
Background:
I have a RESTful resource that outputs events for fullcalendar to consume in JSON 
format.  These events are returned with a className of "custom" and editable:true.  

I have two places in my app that use the fullcalendar plugin.  One is display-only 
and the other one is editable.  I use disableDragging/disableResizing on the 
display-only calendar.  

Here is the CSS:

.custom,
.fc-agenda .custom .fc-event-time,
.custom a {
    cursor: default;
}

On the display-only calendar, this displays events that cannot be edited and the 
cursor doesn't indicate that it can be edited.  This is what I want.

On the editable calendar, the events can be edited, but the cursor doesn't change to 
indicate this capability. I want the cursor to use fullcalendar's CSS settings for 
cursor (pointer, s-resize, etc.)

I could return a different classnames to each calendar, such as "custom" and 
"editable". But the server would then need to know when to output which className.  
I would need to send a parameter or use a different URL, and I don't want to 
complicate the server API just for this simple purpose.

Could fullcalendar be updated to change the cursor of an event based on if it is 
editable or not?  I've got this working with the following update to the code (this 
code should be repeated in 3 different locations):

if (event.editable || event.editable == undefined && options.editable) {
	draggableDayEvent(event, eventElement, seg.isStart);
	if (seg.isEnd) {
		view.resizableDayEvent(event, eventElement, colWidth);
	}
	// Added TNM 2010/02/05
	if (options.disableDragging && options.disableResizing) {
		eventElement.children('a').css('cursor','default');
	}
}
// Added TNM 2010/02/05
else {
	eventElement.children('a').css('cursor','default');
}

I realize this doesn't take into account Events with clickable URLs.  Right now I 
don't want clickable URLs anyway and am disabling all URLs by overriding eventClick 
to return false.  But for fullcalendar to know if you want a URL to be clickable or 
not, just overriding eventClick won't let it know.  Yet another setting might be 
necessary. Something like "clickable: false". Then people wouldn't have to override 
eventClick either.


Feb 6, 2010
Project Member #1 adamrs...@gmail.com
the best solution might be to use eventRender 
(http://arshaw.com/fullcalendar/docs/event_rendering/eventRender/):

$('#calendar').fullCalendar({
    eventRender: function(event, element) {
        if (event.editable) {
           element.css('cursor', 'whatever');
        }
    }
});

does this help at all?
Feb 6, 2010
#2 yowza...@gmail.com
Ah, yes that should work!  I'll give it a shot.  Thanks!

Still, it seems like this might be good to add to the core.  It doesn't make sense to 
show a pointer cursor if the item isn't editable or have a URL.
Feb 6, 2010
Project Member #3 adamrs...@gmail.com
yeah, you are probably right. if i attached an "fc-event-editable" class to editable 
events, and used the "a:link" pseudo class, you could have control over this stuff via 
the stylesheet
Summary: Default cursor for non-editable no-url events
Status: Accepted
Mar 20, 2011
Project Member #4 adamrs...@gmail.com
fixed in 1.5 (just released)
Status: Fixed
Aug 13, 2013
Project Member #5 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #6 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting