Make WordPress Core


Ignore:
Timestamp:
04/03/2015 04:51:18 AM (11 years ago)
Author:
helen
Message:

Spinners: Toggle a class instead of show/hide.

Toggling spinners also now uses visibility instead of display, so that the space is always reserved and nothing moves around unexpectedly.

props cdog, MikeHansenMe, valendesigns.
fixes #22839. see #31875, #30725.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-general.php

    r31993 r31996  
    6161                $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
    6262                        var format = $(this);
    63                         format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
     63                        format.siblings( '.spinner' ).addClass( 'is-active' );
    6464                        $.post(ajaxurl, {
    6565                                        action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
    6666                                        date : format.val()
    67                                 }, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
     67                                }, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
    6868                });
    6969
Note: See TracChangeset for help on using the changeset viewer.