fragaria / angular-daterangepicker

Angular.js wrapper for dangrossman/bootstrap-daterangepicker
MIT License
519 stars 372 forks source link

showCalendar.daterangepicker event handler invoked when alwaysShowCalendars is set to false #203

Closed danallen88 closed 8 years ago

danallen88 commented 8 years ago

Say my configuration looked like this:

dateRangeOpts: {
         ...
         alwaysShowCalendars: false,
         ...
         eventHandlers: {
                'apply.daterangepicker': function( scope ) {
                        console.log('apply');
                },
                'show.daterangepicker': function( scope ) {
                    console.log('show');
                },
                'showCalendar.daterangepicker': function( scope ) {
                    console.log('showCalendar');
                }
          }
}

Then every time the daterangepicker is opened, even if the calendars are not displayed, both showCalendar.daterangepicker and show.daterangepicker event handlers are invoked.

danallen88 commented 8 years ago

I believe this was due to modified source per the suggestion in https://github.com/fragaria/angular-daterangepicker/issues/187