Simplify accordion implementation for better reliability
This commit is contained in:
@ -743,7 +743,6 @@ function wp_allstars_settings_page() {
|
|||||||
<script>
|
<script>
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
// Initialize accordion functionality
|
// Initialize accordion functionality
|
||||||
function initAccordion() {
|
|
||||||
$('.wp-allstars-expand-settings').each(function() {
|
$('.wp-allstars-expand-settings').each(function() {
|
||||||
var $button = $(this);
|
var $button = $(this);
|
||||||
var $panel = $button.closest('.wp-allstars-toggle').find('.wp-allstars-toggle-settings');
|
var $panel = $button.closest('.wp-allstars-toggle').find('.wp-allstars-toggle-settings');
|
||||||
@ -756,7 +755,7 @@ function wp_allstars_settings_page() {
|
|||||||
.toggleClass('dashicons-arrow-down-alt2', !isExpanded);
|
.toggleClass('dashicons-arrow-down-alt2', !isExpanded);
|
||||||
|
|
||||||
// Handle click events
|
// Handle click events
|
||||||
$button.off('click').on('click', function(e) {
|
$button.on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
@ -771,10 +770,6 @@ function wp_allstars_settings_page() {
|
|||||||
$panel.slideToggle(200);
|
$panel.slideToggle(200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize on page load
|
|
||||||
initAccordion();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user