Skip to content

Commit

Permalink
Fix Content Calendar schedule date select not working
Browse files Browse the repository at this point in the history
  • Loading branch information
olatechpro committed Jul 24, 2024
1 parent bd4f327 commit ae0385d
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions modules/content-board/lib/content-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,28 +203,24 @@ jQuery(document).ready(function ($) {
var modalDisplay = $(modalID).css('display');
var isCustomModal = $(modalID).hasClass('customize-customize-item-modal');
var isPostModal = $(modalID).hasClass('new-post-modal');

$('.content-board-modal').hide();

if (modalDisplay !== 'block') {
if (isCustomModal) {
var adminBarHeight = $('#wpadminbar').outerHeight() || 0;
var buttonHeight = $(this).outerHeight();
var windowHeight = $(window).height();
var maxModalHeight = windowHeight - $(this).position().top - buttonHeight - adminBarHeight + 50;

$(modalID).css({
top: $('.pp-version-notice-bold-purple').length > 0 ? -32 : 0,
left: isPostModal ? $(this).position().left - $(modalID).outerWidth() - 5 : $(this).position().left + $(this).outerWidth() + 5,
//'max-height': maxModalHeight
}).show();
$('.content-board-modal').hide();
if (isCustomModal) {
var adminBarHeight = $('#wpadminbar').outerHeight() || 0;
var buttonHeight = $(this).outerHeight();
var windowHeight = $(window).height();
var maxModalHeight = windowHeight - $(this).position().top - buttonHeight - adminBarHeight + 50;
$(modalID).css({
top: $('.pp-version-notice-bold-purple').length > 0 ? -32 : 0,
left: isPostModal ? $(this).position().left - $(modalID).outerWidth() - 5 : $(this).position().left + $(this).outerWidth() + 5,
//'max-height': maxModalHeight
}).show();

} else {
$(modalID).css({
top: $(this).position().top + 28,
left: $(this).position().left
}).show();
}
} else {
$(modalID).css({
top: $(this).position().top + 28,
left: $(this).position().left
}).show();
}
});

Expand Down

0 comments on commit ae0385d

Please sign in to comment.