Changeset 29582
- Timestamp:
- 08/24/2014 04:17:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-views.js
r29568 r29582 5254 5254 5255 5255 this.listenTo( this.controller, 'library:selection:add', this.attachmentFocus ); 5256 this.listenTo( this.controller, 'attachment:keydown:arrow', this.arrowEvent );5257 5256 5258 5257 // Throttle the scroll handler and bind this. … … 5282 5281 arrowEvent: function( event ) { 5283 5282 var attachments = this.$el.children( 'li' ), 5284 perRow = Math.round( this.$el.width() / attachments.first().outerWidth()),5283 perRow = this.$el.data( 'columns' ), 5285 5284 index = attachments.filter( ':focus' ).index(), 5286 5285 row = ( index + 1 ) <= perRow ? 1 : Math.ceil( ( index + 1 ) / perRow ); 5286 5287 if ( index === -1 ) { 5288 return; 5289 } 5287 5290 5288 5291 // Left arrow … … 6001 6004 AttachmentView: this.options.AttachmentView 6002 6005 }); 6006 6007 // Add keydown listener to the instance of the Attachments view 6008 this.attachments.listenTo( this.controller, 'attachment:keydown:arrow', this.attachments.arrowEvent ); 6003 6009 6004 6010 this.views.add( this.attachments );
Note: See TracChangeset
for help on using the changeset viewer.