Changeset 22790
- Timestamp:
- 11/21/2012 08:27:49 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22787 r22790 1050 1050 } 1051 1051 }); 1052 this.views.set( '.media-frame-uploader', this.uploader ); 1052 1053 } 1053 1054 … … 1060 1061 1061 1062 media.view.Frame.prototype.render.apply( this, arguments ); 1062 1063 // Render the window uploader if it exists.1064 if ( this.uploader )1065 this.uploader.render().$el.appendTo( this.$el );1066 1067 1063 return this; 1068 1064 }, … … 1734 1730 }); 1735 1731 1736 if ( uploader.dropzone ) { 1737 // Ensure the dropzone is a jQuery collection. 1738 if ( ! (uploader.dropzone instanceof $) ) 1739 uploader.dropzone = $( uploader.dropzone ); 1740 1741 // Attempt to initialize the uploader whenever the dropzone is hovered. 1742 uploader.dropzone.one( 'mouseenter dragenter', _.bind( this.maybeInitUploader, this ) ); 1743 } 1744 }, 1745 1746 render: function() { 1747 this.maybeInitUploader(); 1748 this.$el.html( this.template( this.options ) ); 1749 return this; 1732 // Ensure the dropzone is a jQuery collection. 1733 if ( uploader.dropzone && ! (uploader.dropzone instanceof $) ) 1734 uploader.dropzone = $( uploader.dropzone ); 1750 1735 }, 1751 1736 … … 1755 1740 }, 1756 1741 1757 maybeInitUploader: function() { 1758 var $id, dropzone; 1759 1760 // If the uploader already exists or the body isn't in the DOM, bail. 1761 if ( this.uploader || ! this.$el.closest('body').length ) 1742 ready: function() { 1743 var postId = media.view.settings.postId, 1744 dropzone; 1745 1746 // If the uploader already exists, bail. 1747 if ( this.uploader ) 1762 1748 return; 1763 1749 1764 $id = $('#post_ID'); 1765 if ( $id.length ) 1766 this.options.uploader.params.post_id = $id.val(); 1750 if ( postId ) 1751 this.options.uploader.params.post_id = postId; 1767 1752 1768 1753 this.uploader = new wp.Uploader( this.options.uploader ); -
trunk/wp-includes/media.php
r22783 r22790 1407 1407 <div class="media-frame-sidebar"></div> 1408 1408 <div class="media-frame-toolbar"></div> 1409 <div class="media-frame-uploader"></div> 1409 1410 </script> 1410 1411
Note: See TracChangeset
for help on using the changeset viewer.