Fix accordion toggle functionality and reposition chevron icon
This commit is contained in:
@ -659,6 +659,7 @@ function wp_allstars_settings_page() {
|
|||||||
<div class="wp-allstars-settings-content">
|
<div class="wp-allstars-settings-content">
|
||||||
<div class="wp-allstars-toggle">
|
<div class="wp-allstars-toggle">
|
||||||
<div class="wp-allstars-toggle-header">
|
<div class="wp-allstars-toggle-header">
|
||||||
|
<div class="wp-allstars-toggle-main">
|
||||||
<label for="wp_allstars_auto_upload_images">
|
<label for="wp_allstars_auto_upload_images">
|
||||||
<div class="wp-toggle-switch">
|
<div class="wp-toggle-switch">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@ -678,6 +679,7 @@ function wp_allstars_settings_page() {
|
|||||||
<p class="description">
|
<p class="description">
|
||||||
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wp-allstars'); ?>
|
<?php esc_html_e('Import images that have external URLs into your Media Library when saving. Consider disabling during large data imports with many external image URLs.', 'wp-allstars'); ?>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
<div class="wp-allstars-toggle-settings" style="display: none;">
|
<div class="wp-allstars-toggle-settings" style="display: none;">
|
||||||
<div class="wp-allstars-setting-row">
|
<div class="wp-allstars-setting-row">
|
||||||
<label for="wp_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label>
|
<label for="wp_max_width"><?php esc_html_e('Max Width', 'wp-allstars'); ?></label>
|
||||||
@ -738,12 +740,32 @@ function wp_allstars_settings_page() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.wp-allstars-toggle-main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.wp-allstars-expand-settings {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #2271b1;
|
||||||
|
}
|
||||||
|
.wp-allstars-expand-settings:hover {
|
||||||
|
color: #135e96;
|
||||||
|
}
|
||||||
|
.wp-allstars-expand-settings:focus {
|
||||||
|
outline: 1px solid #2271b1;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
$('.wp-allstars-expand-settings').on('click', function(e) {
|
$('.wp-allstars-expand-settings').on('click', function() {
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
var $button = $(this);
|
var $button = $(this);
|
||||||
var $settings = $button.closest('.wp-allstars-toggle').find('.wp-allstars-toggle-settings');
|
var $settings = $button.closest('.wp-allstars-toggle').find('.wp-allstars-toggle-settings');
|
||||||
var isExpanded = $button.attr('aria-expanded') === 'true';
|
var isExpanded = $button.attr('aria-expanded') === 'true';
|
||||||
@ -753,8 +775,8 @@ function wp_allstars_settings_page() {
|
|||||||
|
|
||||||
// Toggle icon
|
// Toggle icon
|
||||||
$button.find('.dashicons')
|
$button.find('.dashicons')
|
||||||
.toggleClass('dashicons-arrow-down-alt2', isExpanded)
|
.removeClass(isExpanded ? 'dashicons-arrow-up-alt2' : 'dashicons-arrow-down-alt2')
|
||||||
.toggleClass('dashicons-arrow-up-alt2', !isExpanded);
|
.addClass(isExpanded ? 'dashicons-arrow-down-alt2' : 'dashicons-arrow-up-alt2');
|
||||||
|
|
||||||
// Toggle settings panel with animation
|
// Toggle settings panel with animation
|
||||||
$settings.slideToggle(200);
|
$settings.slideToggle(200);
|
||||||
|
Reference in New Issue
Block a user