Skip to content

Commit

Permalink
Add current post to content modal
Browse files Browse the repository at this point in the history
  • Loading branch information
olatechpro committed Jan 29, 2025
1 parent 9d079d5 commit 9a8992f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions modules/calendar/lib/async-calendar/js/Functions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ export function openPostModal(post_id) {

var can_edit_post = Number(post.can_edit_post) > 0;

var target_post = jQuery('.publishpress-calendar .publishpress-calendar-item.post-' + post_id);

// build header
var popup_header = '<div class="pp-popup-modal-header">';

Expand All @@ -325,6 +327,10 @@ export function openPostModal(post_id) {
popup_header += '</div>';
}

popup_header += '<div class="pp-modal-navigation-current">';
popup_header += '<span class="modal-nav-current" style="color:' + target_post.css('background-color') + '"> ' + post.filtered_title + '</span>';
popup_header += '</div>';

if (next_post.post_id != post.post_id) {
popup_header += '<div class="pp-modal-navigation-next">';
popup_header += '<a title="' + publishpressCalendarParams.strings.next_label + '" href="#" class="modal-nav-next" data-post_id="' + next_post.post_id + '">' + next_post.filtered_title + ' <span class="dashicons dashicons-arrow-right-alt"></span></a>';
Expand Down
Loading

0 comments on commit 9a8992f

Please sign in to comment.