Simplify loading indicators with a single spinner next to Loading text

This commit is contained in:
Marcus Quinn
2025-03-16 18:50:28 +00:00
parent a28f3ed267
commit c704dbecd8
2 changed files with 4 additions and 17 deletions

View File

@ -319,7 +319,6 @@ function wp_allstars_generate_plugin_cards($plugins) {
<div class="name column-name">
<h3>
<?php echo esc_html($plugin->name); ?>
<img src="<?php echo esc_url(admin_url('images/spinner.gif')); ?>" class="plugin-spinner spinner" alt="">
</h3>
</div>
<div class="action-links">
@ -627,7 +626,7 @@ function wp_allstars_settings_page() {
if ($("#wpa-plugin-list").length && $("#wpa-plugin-list").is(":empty")) {
var category = "' . esc_js($active_category) . '";
var $container = $("#wpa-plugin-list");
var $loadingOverlay = $("<div class=\"wp-allstars-loading-overlay\"><span class=\"spinner is-active\"></span><p>Loading plugins...</p></div>");
var $loadingOverlay = $("<div class=\"wp-allstars-loading-overlay\"><div style=\"display: flex; align-items: center; justify-content: center;\"><span class=\"spinner is-active\" style=\"margin-right: 10px;\"></span><p>Loading plugins...</p></div></div>");
// Show loading overlay
$container.css("position", "relative").append($loadingOverlay);
@ -650,13 +649,7 @@ function wp_allstars_settings_page() {
initPluginActions();
}
// Show standard WordPress spinner in each plugin card
$(".plugin-card .plugin-spinner").addClass("is-active").show();
// Hide spinners after all plugin details have loaded
setTimeout(function() {
$(".plugin-card .plugin-spinner").removeClass("is-active").hide();
}, 1000);
// Spinners have been removed from individual cards
} else {
$container.html("<div class=\"notice notice-error\"><p>" + response.data + "</p></div>");
}