~canonical-sysadmins/wordpress/4.7

« back to all changes in this revision

Viewing changes to wp-content/themes/twentyfifteen/js/customize-preview.js

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:04:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: nick.moffitt@canonical.com-20150115110426-5stm1p14cfnxrtme
New Upstream Version 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Live-update changed settings in real time in the Customizer preview.
 
3
 */
 
4
 
 
5
( function( $ ) {
 
6
        var $style = $( '#twentyfifteen-color-scheme-css' ),
 
7
                api = wp.customize;
 
8
 
 
9
        if ( ! $style.length ) {
 
10
                $style = $( 'head' ).append( '<style type="text/css" id="twentyfifteen-color-scheme-css" />' )
 
11
                                    .find( '#twentyfifteen-color-scheme-css' );
 
12
        }
 
13
 
 
14
        // Site title.
 
15
        api( 'blogname', function( value ) {
 
16
                value.bind( function( to ) {
 
17
                        $( '.site-title a' ).text( to );
 
18
                } );
 
19
        } );
 
20
 
 
21
        // Site tagline.
 
22
        api( 'blogdescription', function( value ) {
 
23
                value.bind( function( to ) {
 
24
                        $( '.site-description' ).text( to );
 
25
                } );
 
26
        } );
 
27
 
 
28
        // Color Scheme CSS.
 
29
        api.bind( 'preview-ready', function() {
 
30
                api.preview.bind( 'update-color-scheme-css', function( css ) {
 
31
                        $style.html( css );
 
32
                } );
 
33
        } );
 
34
 
 
35
} )( jQuery );