EventClick changes only double-click in the jQuery FullCalendar plugin

Is it possible that eventClick will happen with a double click and not with a single click? I know how I can do this, but is there an elegant way to do this with this plugin without changing the kernel?

+3
source share
1 answer

Yes it is possible. You must change the plugin. You need to change the event handlers, for example:

    eventElementHandlers: function (event, eventElement)
    {
        var view = this; 
        eventElement
        .click(function (ev)
        {
            if (!eventElement.hasClass('ui-draggable-dragging') &&
                !eventElement.hasClass('ui-resizable-resizing'))
            {
                return view.trigger('eventClick', this, event, ev);
            }
        })
        .dblclick(function (ev)
        {
            return view.trigger('dblclick', this, event, ev);
        })
        .hover(
            function (ev)
            {
                view.trigger('eventMouseover', this, event, ev);
            },
            function (ev)
            {
                view.trigger('eventMouseout', this, event, ev);
            }
        );
    },

You can add more events as well. Here you can find a list of events that are part of jQuery. There are plugins for the right click and another event.

+4
source

Source: https://habr.com/ru/post/1748718/


All Articles