angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

using prev/next methods with external buttons #522

Closed ohmmho closed 6 years ago

ohmmho commented 6 years ago

Hi :)

I'm using external buttons for prev and next buttons like this:

$('#my-prev-button').click(function() { $('#calendar').fullCalendar('prev'); });

$('#my-next-button').click(function() { $('#calendar').fullCalendar('next'); });

I expect these buttons to navigate one month up or down, but when I click on it, multiple clicks are thrown, resulting in moving two months (sometimes more) away instead of one.

To make work this code I placed it inside the viewRender function, which I'm suspecting is the cause of this behaviour. However, I tried to fire these events from the controller and I get same behaviour.

Any help would be much appreciated, thanks!

ohmmho commented 6 years ago

finally moved that button initialization to the directive source, is woking fine.