Fix loading indicator with proper CSS and consistent positioning

This commit is contained in:
Marcus Quinn
2025-03-16 18:55:35 +00:00
parent 1694c6c9d5
commit 8de06cb869
3 changed files with 33 additions and 2 deletions

View File

@ -253,6 +253,37 @@ body.wp-admin .plugin-card-bottom .compatibility-untested *,
color: #000 !important; color: #000 !important;
} }
/* Loading overlay styling */
.wp-allstars-loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.9);
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
min-height: 200px;
}
.wp-allstars-loading-container {
text-align: center;
padding: 20px;
}
.wp-allstars-loading-container p {
font-size: 16px;
margin-bottom: 60px;
}
.wp-allstars-loading-container .spinner {
float: none;
margin: 0 auto;
display: block;
}
.plugin-card:hover { .plugin-card:hover {
border-color: #999; border-color: #999;

View File

@ -155,7 +155,7 @@ jQuery(document).ready(function($) {
// Function to load plugins // Function to load plugins
function loadPlugins(category) { function loadPlugins(category) {
var $container = $('#wpa-plugin-list'); var $container = $('#wpa-plugin-list');
var $loadingOverlay = $('<div class="wp-allstars-loading-overlay"><div style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;"><p style="margin-top: 0;">Loading plugins...</p><span class="spinner is-active" style="margin-top: 50px;"></span></div></div>'); var $loadingOverlay = $('<div class="wp-allstars-loading-overlay"><div class="wp-allstars-loading-container"><p>Loading plugins...</p><span class="spinner is-active"></span></div></div>');
// Show loading overlay // Show loading overlay
$container.css('position', 'relative').append($loadingOverlay); $container.css('position', 'relative').append($loadingOverlay);

View File

@ -626,7 +626,7 @@ function wp_allstars_settings_page() {
if ($("#wpa-plugin-list").length && $("#wpa-plugin-list").is(":empty")) { if ($("#wpa-plugin-list").length && $("#wpa-plugin-list").is(":empty")) {
var category = "' . esc_js($active_category) . '"; var category = "' . esc_js($active_category) . '";
var $container = $("#wpa-plugin-list"); var $container = $("#wpa-plugin-list");
var $loadingOverlay = $("<div class=\"wp-allstars-loading-overlay\"><div style=\"position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;\"><p style=\"margin-top: 0;\">Loading plugins...</p><span class=\"spinner is-active\" style=\"margin-top: 50px;\"></span></div></div>"); var $loadingOverlay = $("<div class=\"wp-allstars-loading-overlay\"><div class=\"wp-allstars-loading-container\"><p>Loading plugins...</p><span class=\"spinner is-active\"></span></div></div>");
// Show loading overlay // Show loading overlay
$container.css("position", "relative").append($loadingOverlay); $container.css("position", "relative").append($loadingOverlay);