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

Commit

Permalink
Adds the abiliy to pass extra options to the popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Apr 20, 2016
1 parent 521d399 commit 271cd78
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions onegov/town/assets/js/reservationcalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ $.fn.reservationCalendar = function(options) {

// handles clicks on events
rc.setupEventPopups = function(event, element, view) {

$(element).click(function() {
var calendar = $(view.el.closest('.fc'));
rc.showActionsPopup(calendar, element, event);
Expand All @@ -233,10 +232,10 @@ rc.showActionsPopup = function(calendar, element, event) {
rc.showPopup(calendar, element, $(event.actions.join('')));
};

rc.showPopup = function(calendar, element, content) {
rc.showPopup = function(calendar, element, content, options) {
$(element).addClass('has-popup');

$('<div class="popup" />').append(content).popup({
var defaultPopupOptions = {
autoopen: true,
horizontal: 'right',
offsetleft: -10,
Expand All @@ -248,7 +247,11 @@ rc.showPopup = function(calendar, element, content) {
onclose: function() {
$(element).removeClass('has-popup');
}
});
};

$('<div class="popup" />').append(content).popup(
$.extend(true, defaultPopupOptions, options || {})
);
};

rc.onPopupOpen = function(calendar) {
Expand Down

0 comments on commit 271cd78

Please sign in to comment.