Fix notification positioning, clickable areas, and AJAX nonce issues

This commit is contained in:
Marcus Quinn
2025-03-16 03:46:17 +00:00
parent 4afe97ba3d
commit befa897108
2 changed files with 18 additions and 9 deletions

View File

@ -199,6 +199,8 @@ input:checked + .wp-toggle-slider:before {
/* Expandable Panel Component */ /* Expandable Panel Component */
.wp-allstars-toggle-header { .wp-allstars-toggle-header {
cursor: pointer; cursor: pointer;
position: relative;
z-index: 1;
} }
.wp-allstars-toggle-header::after { .wp-allstars-toggle-header::after {
@ -634,14 +636,15 @@ input:checked + .wp-toggle-slider:before {
.wp-allstars-toggle-left label, .wp-allstars-toggle-left label,
.wp-allstars-setting-row label { .wp-allstars-setting-row label {
position: relative; position: relative;
padding-right: 80px; padding-right: 40px;
display: inline-block;
} }
.wp-setting-left label .wp-setting-notification, .wp-setting-left label .wp-setting-notification,
.wp-allstars-toggle-left label .wp-setting-notification, .wp-allstars-toggle-left label .wp-setting-notification,
.wp-allstars-setting-row label .wp-setting-notification { .wp-allstars-setting-row label .wp-setting-notification {
position: absolute; position: absolute;
right: 0; right: -5px;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
@ -662,4 +665,10 @@ input:checked + .wp-toggle-slider:before {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
.wp-allstars-toggle-main {
padding-right: 40px; /* Space for chevron */
position: relative;
z-index: 1;
} }

View File

@ -106,10 +106,7 @@ jQuery(document).ready(function($) {
var $input = $(this); var $input = $(this);
var option = $input.attr('name'); var option = $input.attr('name');
var value = $input.val(); var value = $input.val();
var $label = $input.prev('label'); var $label = $input.closest('.wp-allstars-setting-row').find('label').first();
if (!$label.length) {
$label = $input.closest('.wp-allstars-setting-row').find('label');
}
updateOption(option, value) updateOption(option, value)
.then(function() { .then(function() {
@ -159,13 +156,16 @@ jQuery(document).ready(function($) {
// Show loading overlay // Show loading overlay
$('.wpa-loading-overlay').fadeIn(); $('.wpa-loading-overlay').fadeIn();
// Log the nonce for debugging
console.log('Using nonce:', wpAllstars.nonce);
$.ajax({ $.ajax({
url: ajaxurl, url: ajaxurl,
type: 'POST', type: 'POST',
data: { data: {
action: 'wp_allstars_get_plugins', action: 'wp_allstars_get_plugins',
category: category || 'minimal', category: category || 'minimal',
_ajax_nonce: wpAllstars.nonce nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
@ -199,7 +199,7 @@ jQuery(document).ready(function($) {
type: 'POST', type: 'POST',
data: { data: {
action: 'wp_allstars_get_theme', action: 'wp_allstars_get_theme',
_ajax_nonce: wpAllstars.nonce nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
@ -264,7 +264,7 @@ jQuery(document).ready(function($) {
data: { data: {
action: 'wp_allstars_activate_theme', action: 'wp_allstars_activate_theme',
theme: slug, theme: slug,
_ajax_nonce: wpAllstars.nonce nonce: wpAllstars.nonce
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {