Changeset 42134
- Timestamp:
- 11/09/2017 03:54:13 AM (7 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/forms.css
r41972 r42134 898 898 .options-general-php .spinner { 899 899 float: none; 900 margin: 0 3px;900 margin: -3px 3px 0; 901 901 } 902 902 -
trunk/src/wp-admin/includes/options.php
r41598 r42134 52 52 $("input[name='date_format']").click(function(){ 53 53 if ( "date_format_custom_radio" != $(this).attr("id") ) 54 $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );54 $( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); 55 55 }); 56 56 $( 'input[name="date_format_custom"]' ).on( 'click input', function() { … … 60 60 $("input[name='time_format']").click(function(){ 61 61 if ( "time_format_custom_radio" != $(this).attr("id") ) 62 $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );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 $( 'input[name="time_format_custom"]' ).on( 'click input', function() { … … 66 66 }); 67 67 $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() { 68 var format = $(this); 69 format.siblings( '.spinner' ).addClass( 'is-active' ); 70 $.post(ajaxurl, { 71 action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format', 68 var format = $( this ), 69 fieldset = format.closest( 'fieldset' ), 70 example = fieldset.find( '.example' ), 71 spinner = fieldset.find( '.spinner' ); 72 73 spinner.addClass( 'is-active' ); 74 75 $.post( ajaxurl, { 76 action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format', 72 77 date : format.val() 73 }, function( d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );78 }, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } ); 74 79 }); 75 80
Note: See TracChangeset
for help on using the changeset viewer.