Full Calendar event hyperlinks automatically fire in Firefox

六眼飞鱼酱① 提交于 2019-12-10 15:17:45

问题


I'm using Full Calendar with draggable events. I have specified a url in the event object which causes the event to link to a page. Whenever I drag an event in IE or Chrome, the click event does not fire (that's good). But it does in Firefox. There is an event called eventClick provided by Full Calendar but apparently that doesn't fire before the hyperlink redirects. Is there some way to prevent drags from firing the click event without using some jQuery hack?


回答1:


The problem is with event.url

Change your event from url: to hackurl:

And then in your click event instead of:

if (event.url)
{ execute code }

have

if (event.hackurl)
{ execute code }

I have the exact same problem and was fixed by simply using a different custom attribute - for now it's a clean and very simple workaround that doesn't require hacking jquery or fullcalendar javascript.

Hope it helps



来源:https://stackoverflow.com/questions/12923099/full-calendar-event-hyperlinks-automatically-fire-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!