PluginProbe
Smart Custom Fields / trunk
Smart Custom Fields vtrunk
1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.7.0 2.0.0 2.0.1 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 All 68 releases
smart-custom-fields / js / editor-datepicker.js

editor-datepicker.js in Smart Custom Fields trunk, at js/editor-datepicker.js

27 lines 837 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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