PluginProbe ʕ •ᴥ•ʔ
Easy Actions Scheduler Cleaner / 1.1.0
Easy Actions Scheduler Cleaner v1.1.0
trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0
easy-actions-scheduler-cleaner-ayudawp / assets / admin-script.js
easy-actions-scheduler-cleaner-ayudawp / assets Last commit date
admin-script.js 4 months ago admin-style.css 4 months ago
admin-script.js
39 lines
1 /**
2 * Admin scripts for Easy Actions Scheduler Cleaner
3 *
4 * Handles the schedule options toggle visibility.
5 *
6 * @package EasyActionsSchedulerCleanerAyudaWP
7 * @since 1.1.0
8 */
9
10 ( function () {
11 'use strict';
12
13 document.addEventListener( 'DOMContentLoaded', function () {
14 var toggle = document.getElementById( 'easc-schedule-toggle' );
15 var options = document.getElementById( 'easc-schedule-options' );
16
17 if ( ! toggle || ! options ) {
18 return;
19 }
20
21 /**
22 * Toggle schedule options visibility based on master checkbox.
23 */
24 function updateOptionsVisibility() {
25 if ( toggle.checked ) {
26 options.classList.remove( 'easc-disabled' );
27 } else {
28 options.classList.add( 'easc-disabled' );
29 }
30 }
31
32 // Set initial state.
33 updateOptionsVisibility();
34
35 // Listen for changes.
36 toggle.addEventListener( 'change', updateOptionsVisibility );
37 } );
38 } )();
39