]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/custom-background.js
WordPress 4.7-scripts
[autoinstalls/wordpress.git] / wp-admin / js / custom-background.js
index 81fd59170c659daf0f9224a4b34ed7505deb04f4..c3f4e294f1a6da867561d2feda9dbab76a029284 100644 (file)
                        }
                });
 
-               $('input[name="background-position-x"]').change(function() {
-                       bgImage.css('background-position', $(this).val() + ' top');
+               $( 'select[name="background-size"]' ).change( function() {
+                       bgImage.css( 'background-size', $( this ).val() );
                });
 
-               $('input[name="background-repeat"]').change(function() {
-                       bgImage.css('background-repeat', $(this).val());
+               $( 'input[name="background-position"]' ).change( function() {
+                       bgImage.css( 'background-position', $( this ).val() );
+               });
+
+               $( 'input[name="background-repeat"]' ).change( function() {
+                       bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' );
+               });
+
+               $( 'input[name="background-attachment"]' ).change( function() {
+                       bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' );
                });
 
                $('#choose-from-library-link').click( function( event ) {