Skip to content

Commit

Permalink
Merge pull request #15 from alextselegidis/develop
Browse files Browse the repository at this point in the history
Add custom render method that can be easily overriden
  • Loading branch information
tm8544 committed May 18, 2024
2 parents d1acc60 + e4cc2fc commit 83ecd5c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/js/utils/calendar_default_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ App.Utils.CalendarDefaultView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down Expand Up @@ -521,6 +523,8 @@ App.Utils.CalendarDefaultView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down Expand Up @@ -689,6 +693,8 @@ App.Utils.CalendarDefaultView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down
12 changes: 12 additions & 0 deletions assets/js/utils/calendar_event_popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,21 @@ App.Utils.CalendarEventPopover = (function () {
}).html();
}

/**
* Render custom content into the popover of events.
*
* @param {Object} info The info object as passed from FullCalendar
*
* @return {Object|String|null} Return HTML string, a jQuery selector or null for nothing.
*/
function renderCustomContent(info) {
return null; // Default behavior
}

return {
renderPhoneIcon,
renderMapIcon,
renderMailIcon,
renderCustomContent,
};
})();
6 changes: 6 additions & 0 deletions assets/js/utils/calendar_table_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,8 @@ App.Utils.CalendarTableView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down Expand Up @@ -1251,6 +1253,8 @@ App.Utils.CalendarTableView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down Expand Up @@ -1416,6 +1420,8 @@ App.Utils.CalendarTableView = (function () {
}),
$('<br/>'),

App.Utils.CalendarEventPopover.renderCustomContent(info),

$('<hr/>'),

$('<div/>', {
Expand Down

0 comments on commit 83ecd5c

Please sign in to comment.