Skip to content

Commit

Permalink
Merge branch 'development' into update/#1741-Remove-the-Editorial-Fie…
Browse files Browse the repository at this point in the history
…lds-from-the-filters-if-empty
  • Loading branch information
olatechpro committed Sep 3, 2024
2 parents a397917 + 87fbb00 commit 741c2ef
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
32 changes: 32 additions & 0 deletions common/css/publishpress-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,38 @@
font-style: normal;
}

.pp-title-tooltip {
cursor: help;
position: relative;
}

.pp-title-tooltip-text {
display: none;
position: absolute;
background-color: #3c434a;
color: #fff;
padding: 5px;
border-radius: 5px;
font-size: 12px;
white-space: nowrap;
z-index: 1000;
pointer-events: none;
box-shadow: 0px 4px 8px rgb(255, 255, 255);
}

.pp-title-tooltip-text::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-width: 5px;
border-style: solid;
border-color: #333 transparent transparent transparent;
box-shadow: -1px -1px 3px rgba(0, 0, 0, 0.1);
}


[class^="pp-icon-"]:before,
[class*=" pp-icon-"]:before {
font-family: "publishpress" !important;
Expand Down
44 changes: 44 additions & 0 deletions common/js/publishpress-admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
(function ($) {
'use strict';

/**
* All of the code for admin-facing JavaScript source
* should reside in this file.
*/

$(document).ready(function () {

initToolTips();
function initToolTips() {
$('.pp-title-tooltip').each(function() {
var $this = $(this);
var titleText = $this.attr('title');

if (titleText && titleText !== '') {
$this.removeAttr('title');

var $tooltip = $('<div class="pp-title-tooltip-text"></div>').text(titleText);
$('body').append($tooltip);

$this.hover(function() {
$tooltip.show();

// Adjust the tooltip position to account for the arrow
var tooltipTop = $this.offset().top - $tooltip.outerHeight() - 10; // Position 10px above the element
var tooltipLeft = $this.offset().left + ($this.outerWidth() / 2) - ($tooltip.outerWidth() / 2);

$tooltip.css({
top: tooltipTop + 'px',
left: tooltipLeft + 'px',
position: 'absolute'
});
}, function() {
$tooltip.hide();
});
}
});
}

});

})(jQuery);
1 change: 1 addition & 0 deletions common/php/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ public function localize_post_data($localized_post_data, $post, $can_edit_post)
'post_id' => $post->ID,
'post_title' => $post_title,
'raw_title' => $post->post_title,
'filtered_title' => isset($post->filtered_title) ? $post->filtered_title : $post->post_title,
'post_status' => $post->post_status,
'status_label' => $this->get_post_status_friendly_name($post->post_status),
'can_edit_post' => $can_edit_post ? 1 : 0,
Expand Down

0 comments on commit 741c2ef

Please sign in to comment.