contextMenu breaking FullCalendar event dragging

后端 未结 2 1309
一个人的身影
一个人的身影 2021-01-21 11:04

So I recently added a context menu to the events in my FullCalendar using jQuery contextMenu (http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/). It works beaut

2条回答
  •  有刺的猬
    2021-01-21 11:34

    For those who don't want to change plugins, to fix the issue with the context menu mangling the dragability I modified jquery.contextMenu.js

    From:

    $(this).mousedown( function(e) {
                    var evt = e;
                    evt.stopPropagation();
                    $(this).mouseup( function(e) {
                        e.stopPropagation();
                        var srcElement = $(this);
                        $(this).unbind('mouseup');
                                                if (evt.button == 2) {
    

    to

    $(this).mousedown( function(e) {
                    var evt = e;
                    evt.stopPropagation();
                    $(this).mouseup( function(e) {
                        if (evt.button == 2) {
                            e.stopPropagation();
                            var srcElement = $(this);
                            $(this).unbind('mouseup');
    

    This stops the context menu plugin from doing anything on a left click, only on right click.

提交回复
热议问题