bevacqua / rome

:calendar: Customizable date (and time) picker. Opt-in UI, no jQuery!
https://bevacqua.github.io/rome
MIT License
2.91k stars 223 forks source link

How to unbind click handler from rd-date. #134

Closed tarach closed 8 years ago

tarach commented 8 years ago

I want to use rome as sidebar calendar for articles in my laravel projects.

Unfortunately I can't disable its datepicker functionality. Every time i click on a day my current day gets deselected.

I have tried even:

// (...)
this.disableClicks = function()
{
    ths.disableAllElementClicks($(ths.elem));
};
this.disableAllElementClicks = function(elem)
{
    elem.children().each(function()
    {
        $(this).off();
        $(this).unbind();
        this.click = null;
        ths.disableAllElementClicks($(this));
    });
};
// (...)
//.on('ready', C.disableClicks);

But it doesn't work. How can I access calendars crossvent object and remove 'pickDay' on rb-date click event?

bevacqua commented 8 years ago

Use .destroy() on the calendar