Ticket #32860: 32860.patch
File 32860.patch, 1.3 KB (added by , 10 years ago) |
---|
-
src/wp-admin/js/site-icon.js
3 3 4 4 $( function() { 5 5 // Build the choose from library frame. 6 $( '#choose-from-library-link' ). click(function( event ) {6 $( '#choose-from-library-link' ).on( 'click', function( event ) { 7 7 var $el = $(this); 8 8 event.preventDefault(); 9 9 … … 14 14 } 15 15 16 16 // Create the media frame. 17 frame = wp.media.frames.customHeader = wp.media({ 18 // Set the title of the modal. 19 title: $el.data('choose'), 20 21 // Tell the modal to show only images. 22 library: { 23 type: 'image' 24 }, 25 17 frame = wp.media({ 26 18 // Customize the submit button. 27 19 button: { 28 20 // Set the text of the button. … … 30 22 // Tell the button not to close the modal, since we're 31 23 // going to refresh the page when the image is selected. 32 24 close: false 33 } 25 }, 26 states: [ 27 new wp.media.controller.Library({ 28 title: $el.data('choose'), 29 library: wp.media.query({ type: 'image' }), 30 multiple: false, 31 date: false, 32 suggestedWidth: 256, 33 suggestedHeight: 256 34 }) 35 ] 34 36 }); 35 37 36 38 // When an image is selected, run a callback.