Skip to content

Commit

Permalink
Merge pull request #12 from saade/feature/open-event-in-new-tab
Browse files Browse the repository at this point in the history
feat: allow opening or not events in a new tab
  • Loading branch information
saade authored Jun 27, 2022
2 parents 5869d1f + 742a660 commit 3389b6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class CalendarWidget extends FullCalendarWidget
'id' => 2,
'title' => 'Meeting with Pamela',
'start' => now()->addDay(),
'url' => MeetingResource::getUrl('view', ['record' => 2])
'url' => MeetingResource::getUrl('view', ['record' => 2]),
'shouldOpenInNewTab' => true,
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/fullcalendar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
eventClick: ({ event, jsEvent }) => {
if(event.url) {
jsEvent.preventDefault();
window.open(event.url, "_blank");
window.open(event.url, event.extendedProps.shouldOpenInNewTab ? "_blank" : "_self");
return false;
}
@js($this->isListeningClickEvent()) && window.livewire.find("{{ $this->id }}").onEventClick(event)
Expand Down

0 comments on commit 3389b6c

Please sign in to comment.