Serhioromano / bootstrap-calendar

Full view calendar with year, month, week and day views based on templates with Twitter Bootstrap.
http://bootstrap-calendar.eivissapp.com/
MIT License
3.02k stars 1.29k forks source link

Click event inside .cal-slide-content doesn't work #459

Open adanarchila opened 9 years ago

adanarchila commented 9 years ago

First of all thanks for such a great calendar. I appreciate all the effort you've done for this project.

I'm adding a custom link inside the cal-slide-content to edit the event, I've tried a lot of combinations but I can't make the click event to work on those links.

This is how it looks my UI: http://d.pr/i/1k3Ki

This is how it looks my template:

<span id="cal-slide-tick" style="display: none"></span>
<div id="cal-slide-content" class="cal-event-list">
    <ul class="unstyled list-unstyled">
        <% _.each(events, function(event) { %>
            <li>
                <span class="pull-left event <%= event['class'] %>" style="background-color:<%= event['color'] %>"></span>&nbsp;
                <a href="<%= event.url ? event.url : 'javascript:void(0)' %>" data-event-id="<%= event.id %>"
                    data-event-class="<%= event['class'] %>" class="event-item">
                    <%= event.title %></a>
                <a rel="/calendarevent/<%= event.id %>/ajax/edit" href="#" class="grey-link edit-calendar-date">(edit)</a>
            </li>
        <% }) %>
    </ul>
</div>

And this is my JS but it doesn't work, did you code something inside the calendar to avoid any click methods inside it ?

    $(document).on('click', '.edit-calendar-date', function(e){
        e.preventDefault();
        e.stopPropogation();
        console.log('click');
    }); 

Thanks!

adanarchila commented 9 years ago

The temporary fix I found that is not elegant was to use a onclick="function(id)" on each link.