Make WordPress Core


Ignore:
Timestamp:
10/19/2014 09:12:11 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Live-update site title in toolbar when changing the corresponding field in General Settings.

props celloexpressions, avryl.
fixes #28682.

File:
1 edited

Legend:

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

    r29691 r29963  
    2828//<![CDATA[
    2929    jQuery(document).ready(function($){
     30        var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first();
     31
     32        $( '#blogname' ).on( 'input', function() {
     33            var title = $( this ).val();
     34
     35            // Truncate to 40 characters.
     36            if ( 40 < title.length ) {
     37                title = title.substring( 0, 40 ) + '\u2026';
     38            }
     39
     40            $siteName.text( title );
     41        });
     42
    3043        $("input[name='date_format']").click(function(){
    3144            if ( "date_format_custom_radio" != $(this).attr("id") )
Note: See TracChangeset for help on using the changeset viewer.