Changeset 44758
- Timestamp:
- 02/20/2019 10:55:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/options.php
r43571 r44758 62 62 $( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); 63 63 }); 64 64 65 $( 'input[name="time_format_custom"]' ).on( 'click input', function() { 65 66 $( '#time_format_custom_radio' ).prop( 'checked', true ); 66 67 }); 67 $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() { 68 69 $( 'input[name="date_format_custom"], input[name="time_format_custom"]' ).on( 'input', function() { 68 70 var format = $( this ), 69 71 fieldset = format.closest( 'fieldset' ), … … 71 73 spinner = fieldset.find( '.spinner' ); 72 74 73 spinner.addClass( 'is-active' ); 75 // Debounce the event callback while users are typing. 76 clearTimeout( $.data( this, 'timer' ) ); 77 $( this ).data( 'timer', setTimeout( function() { 78 // If custom date is not empty. 79 if ( format.val() ) { 80 spinner.addClass( 'is-active' ); 74 81 75 $.post( ajaxurl, { 76 action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format', 77 date : format.val() 78 }, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } ); 79 }); 82 $.post( ajaxurl, { 83 action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format', 84 date : format.val() 85 }, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } ); 86 } 87 }, 500 ) ); 88 } ); 80 89 81 90 var languageSelect = $( '#WPLANG' ); … … 108 117 }; 109 118 check_disabled(); 110 section.find('input:radio').change(check_disabled);119 section.find( 'input:radio' ).change( check_disabled ); 111 120 }); 112 121 </script>
Note: See TracChangeset
for help on using the changeset viewer.