| 1 |
jQuery( function( $ ) { |
| 2 |
$( '.smart-cf-meta-box-table' ).each( function( i, e ) { |
| 3 |
$( e ).find( '.smart-cf-datepicker' ).each( function( i, e ) { |
| 4 |
if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { |
| 5 |
$( e ).datepicker( $( e ).data( 'js' ) ); |
| 6 |
} |
| 7 |
} ); |
| 8 |
} ); |
| 9 |
|
| 10 |
$( document ).on( 'smart-cf-after-add-group', function( e, obj ) { |
| 11 |
var parent = $( obj.button ).parents( '.smart-cf-meta-box-repeat-tables' ); |
| 12 |
parent.find( '.smart-cf-datepicker' ).each( function( i, e ) { |
| 13 |
if ( $( e ).attr( 'disabled' ) !== 'disabled' ) { |
| 14 |
$( e ).datepicker( $( e ).data( 'js' ) ); |
| 15 |
} |
| 16 |
} ); |
| 17 |
|
| 18 |
$( '.smart-cf-datetime_picker.add' ).each( function ( i, e ) { |
| 19 |
var data = e.getAttribute( 'data-js' ); |
| 20 |
data = JSON.parse( data ); |
| 21 |
data['enableTime'] = true; |
| 22 |
flatpickr( this, data ); |
| 23 |
$( this ).removeClass( 'add' ); |
| 24 |
} ); |
| 25 |
} ); |
| 26 |
} ); |
| 27 |
|