Changeset 29089
- Timestamp:
- 07/11/2014 06:38:51 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29087 r29089 238 238 */ 239 239 editAttachment: function( model ) { 240 var self = this,241 library = this.state().get('library');242 243 240 // Create a new EditAttachment frame, passing along the library and the attachment model. 244 this.editAttachmentFrame =wp.media( {241 wp.media( { 245 242 frame: 'edit-attachments', 246 243 gridRouter: this.gridRouter, 247 library: library,244 library: this.state().get('library'), 248 245 model: model 249 } );250 251 // Listen to keyboard events on the modal252 $( 'body' ).on( 'keydown.media-modal', function( e ) {253 self.editAttachmentFrame.keyEvent( e );254 246 } ); 255 247 }, … … 461 453 }); 462 454 455 this.modal.on( 'open', function () { 456 $( 'body' ).on( 'keydown.media-modal', _.bind( self.keyEvent, self ) ); 457 } ); 458 463 459 // Completely destroy the modal DOM element when closing it. 464 460 this.modal.close = function() { … … 619 615 // The right arrow key 620 616 if ( event.keyCode === 39 ) { 621 if ( ! this.hasNext() ) {622 return;623 }624 617 this.nextMediaItem(); 625 618 } 626 619 // The left arrow key 627 620 if ( event.keyCode === 37 ) { 628 if ( ! this.hasPrevious() ) {629 return;630 }631 621 this.previousMediaItem(); 632 622 }
Note: See TracChangeset
for help on using the changeset viewer.