Cleanup after [29220]:

`media.controller.Library` is State/Backbone Model and should not touch views.

See #23560.


git-svn-id: https://develop.svn.wordpress.org/trunk@29558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-20 19:59:59 +00:00
parent 41a2e31b43
commit 19a34bb49c
1 changed files with 6 additions and 2 deletions

View File

@ -753,8 +753,7 @@
} }
this.get('selection').add( attachment ); this.get('selection').add( attachment );
// Set focus back to where it goes when an attachment is selected. this.frame.trigger( 'library:selection:add' );
$( '.attachments-browser .attachments .attachment' ).first().focus();
}, },
/** /**
@ -5256,6 +5255,7 @@
this.collection.on( 'reset', this.render, this ); this.collection.on( 'reset', this.render, this );
this.listenTo( this.controller, 'library:selection:add', this.attachmentFocus );
this.listenTo( this.controller, 'attachment:keydown:arrow', this.arrowEvent ); this.listenTo( this.controller, 'attachment:keydown:arrow', this.arrowEvent );
// Throttle the scroll handler and bind this. // Throttle the scroll handler and bind this.
@ -5278,6 +5278,10 @@
_.defer( this.setColumns, this ); _.defer( this.setColumns, this );
}, },
attachmentFocus: function() {
this.$( 'li:first' ).focus();
},
arrowEvent: function( event ) { arrowEvent: function( event ) {
var attachments = this.$el.children( 'li' ), var attachments = this.$el.children( 'li' ),
perRow = Math.round( this.$el.width() / attachments.first().outerWidth() ), perRow = Math.round( this.$el.width() / attachments.first().outerWidth() ),