Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Properly pass on event data to rc-* events
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Apr 20, 2016
1 parent 271cd78 commit 2cc786e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions onegov/town/assets/js/reservationcalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ rc.onPopupOpen = function(calendar) {

// pass all reservationcalendar events to the window
_.each(rc.events, function(eventName) {
links.on(eventName, _.debounce(function(data) {
$(calendar).trigger(eventName, data);
links.on(eventName, _.debounce(function(_e, data) {
$(calendar).trigger(eventName, [data, calendar]);
}));
});
};
Expand Down Expand Up @@ -338,21 +338,18 @@ rc.setupReservationSelect = function(fcOptions) {
.insertBefore(view);

calendar.fullCalendar('option', 'aspectRatio', 1.1415926);
rc.resizeReservationSelection(selection);
rc.renderReservationSelection(selection.get(0), calendar, []);

$(calendar).on('rc-reservation-error', function(_e, _data) {

calendar.on('rc-reservation-error', function() {
});

$(calendar).on('rc-reservations-changed', function() {
calendar.on('rc-reservations-changed', function() {
$.getJSON(fcOptions.reservations, function(reservations) {
rc.renderReservationSelection(selection.get(0), calendar, reservations);
});
});

$(calendar).trigger('rc-reservations-changed');

rc.resizeReservationSelection(selection);
calendar.trigger('rc-reservations-changed');
});

fcOptions.windowResize = function() {
Expand Down

0 comments on commit 2cc786e

Please sign in to comment.