fixed calendar redirect bug
This commit is contained in:
1 parent
8e05c669db
commit
a51e207707
2 files changed
+25
-11
No files matched your search
@@ -11,26 +11,36 @@
|
||||
|
||||
::ng-deep full-calendar .fc-daygrid-day-events {
|
||||
display: flex;
|
||||
flex-wrap: wrap; /* Adjust this if items overflow */
|
||||
flex-wrap: wrap;
|
||||
/* Adjust this if items overflow */
|
||||
}
|
||||
|
||||
/* Ensure the event harness keeps the layout */
|
||||
::ng-deep full-calendar .fc-daygrid-event-harness {
|
||||
display: flex;
|
||||
align-items: center; /* Center items vertically within the harness */
|
||||
align-items: center;
|
||||
/* Center items vertically within the harness */
|
||||
}
|
||||
|
||||
/* Align the inner div of each event to row */
|
||||
::ng-deep full-calendar .fc-event>div {
|
||||
display: flex;
|
||||
flex-direction: row; /* Align images and titles horizontally */
|
||||
align-items: center; /* Center items vertically */
|
||||
gap: 5px; /* Space between image and title */
|
||||
flex-direction: row;
|
||||
/* Align images and titles horizontally */
|
||||
align-items: center;
|
||||
/* Center items vertically */
|
||||
gap: 5px;
|
||||
/* Space between image and title */
|
||||
}
|
||||
|
||||
/* Set image sizes to ensure consistency */
|
||||
::ng-deep full-calendar .fc-event img {
|
||||
width: 70px; /* Set consistent width for images */
|
||||
height: auto; /* Maintain aspect ratio */
|
||||
width: 70px;
|
||||
/* Set consistent width for images */
|
||||
height: auto;
|
||||
/* Maintain aspect ratio */
|
||||
}
|
||||
|
||||
::ng-deep full-calendar .fc-daygrid-event-harness {
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -78,7 +78,10 @@ export class CalendarPageComponent implements OnInit {
|
||||
title: `S${e.season.season_number}E${e.episode_number}`,
|
||||
date: e.air_date,
|
||||
photo: this.getPosterPath(e.entry),
|
||||
url: `/entries/${e.entry.id}`,
|
||||
extendedProps: {
|
||||
id: e.entry.id,
|
||||
},
|
||||
// url: `/entries/${e.entry.id}`,
|
||||
};
|
||||
});
|
||||
},
|
||||
@@ -100,10 +103,11 @@ export class CalendarPageComponent implements OnInit {
|
||||
|
||||
handleEventClick(clickInfo: EventClickArg) {
|
||||
// Example: Display an alert with event title
|
||||
// alert(`Event clicked: ${clickInfo.event.title}`);
|
||||
// alert(`Event clicked: ${clickInfo.event.extendedProps['id']}`);
|
||||
// const event = clickInfo.event as any;
|
||||
// console.log(event);
|
||||
// this.router.navigate([`/entries/${clickInfo.event.publicId}`]);
|
||||
const entryId = clickInfo.event.extendedProps['id'];
|
||||
console.log(entryId);
|
||||
this.router.navigate([`/entries/${entryId}`]);
|
||||
// Example: You can also access other event properties
|
||||
// console.log('Clicked event details:', clickInfo.event);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user