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

Open event in new windows not working #332

Open piernik opened 8 years ago

piernik commented 8 years ago

Here is my code:

$scope.calendarOptions = {
    ...
    eventClick: eventClick,
    ...
};

function eventClick(event, jsEvent, view) {
        // opens events in a popup window
        window.open(event.url, 'gcalevent', 'width=700,height=600');
        return false;
}

When clicking event it opens new window but also current window's url is change. return false should prevent this - http://fullcalendar.io/docs/mouse/eventClick/. Is it a bug?

minhtam-nguyennhat commented 8 years ago

Hi there,

I ran into the same problem. Here is the fix

eventClick: function (date, jsEvent, view) {
     if (jsEvent.currentTarget.href) {
          window.open(jsEvent.currentTarget.href);
          return false;
     }
}

Regards, Tam

martin-langhoff commented 8 years ago

Best practice is to use ngModal / ngDialog or similar instead of a separate window.