Changeset 29282
- Timestamp:
- 07/24/2014 07:04:48 PM (10 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29278 r29282 171 171 * Open the Edit Attachment modal. 172 172 */ 173 openEditAttachmentModal: function( model ) {173 openEditAttachmentModal: function( model, currentTarget ) { 174 174 // Create a new EditAttachment frame, passing along the library and the attachment model. 175 175 wp.media( { 176 176 frame: 'edit-attachments', 177 177 gridRouter: this.gridRouter, 178 gridItem: $( currentTarget ).closest( 'li' ), 178 179 library: this.state().get('library'), 179 180 model: model … … 368 369 }); 369 370 371 this.gridItem = this.options.gridItem; 370 372 this.gridRouter = this.options.gridRouter; 371 373 this.library = this.options.library; … … 404 406 self.modal.remove(); 405 407 $( 'body' ).off( 'keydown.media-modal' ); /* remove the keydown event */ 406 408 // Restore the original focus item if possible 409 self.gridItem && self.gridItem.focus(); 407 410 self.resetRoute(); 408 411 } ); -
trunk/src/wp-includes/js/media-views.js
r29278 r29282 4761 4761 // In the grid view, bubble up an edit:attachment event to the controller. 4762 4762 if ( this.controller.isModeActive( 'grid' ) ) { 4763 this.controller.trigger( 'edit:attachment', this.model ); 4763 // Pass the current target to restore focus when closing 4764 this.controller.trigger( 'edit:attachment', this.model, event.currentTarget ); 4764 4765 return; 4765 4766 }
Note: See TracChangeset
for help on using the changeset viewer.