PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 3.8.2
Social Media Auto Poster – Schedule & Publish to Buffer v3.8.2
6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 All 124 releases
wp-to-buffer / _modules / dashboard / js / toggle.js

toggle.js in Social Media Auto Poster – Schedule & Publish to Buffer 3.8.2, at _modules/dashboard/js/toggle.js

58 lines 972 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Provides functionality for toggling checkboxes.
3 *
4 * @package WPZincDashboardWidget
5 * @author WP Zinc
6 */
7
8 /**
9 * Toggle checkboxes
10 *
11 * @since 1.0.0
12 */
13 jQuery( document ).ready(
14 function( $ ) {
15
16 /**
17 * Toggle Checkboxes with Checkbox
18 */
19 $( 'body' ).on(
20 'change',
21 'input.wpzinc-checkbox-toggle',
22 function() {
23
24 var checkboxes = $( 'input.' + $( this ).data( 'target' ) );
25
26 if ( $( this ).is( ':checked' ) ) {
27 $( checkboxes ).prop( 'checked', true );
28 } else {
29 $( checkboxes ).prop( 'checked', false );
30 }
31
32 }
33 );
34
35 /**
36 * Toggle Checkboxes with Link
37 */
38 $( 'body' ).on(
39 'click',
40 'a.wpzinc-checkbox-toggle',
41 function( e ) {
42
43 e.preventDefault();
44
45 var checkboxes = $( 'input.' + $( this ).data( 'target' ) );
46
47 if ( $( checkboxes ).first().is( ':checked' ) ) {
48 $( checkboxes ).prop( 'checked', false );
49 } else {
50 $( checkboxes ).prop( 'checked', true );
51 }
52
53 }
54 );
55
56 }
57 );
58