Insert Media: Don't select a model if it's already selected.

props avryl, adamsilverstein.
fixes #29152.


git-svn-id: https://develop.svn.wordpress.org/trunk@29553 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-08-20 17:19:02 +00:00
parent 89ed2c4217
commit 8e7c9b7d58
1 changed files with 7 additions and 1 deletions

View File

@ -5009,10 +5009,16 @@
return;
}
// Bail if the model is already selected.
if ( this.$el.hasClass( 'selected' ) ) {
return;
}
// Add 'selected' class to model, set aria-checked to true and make the checkbox tabable.
this.$el.addClass( 'selected' ).attr( 'aria-checked', true )
.find( '.check' ).attr( 'tabindex', '0' );
// When selecting an attachment, focus should be transferred to the right details panel
// When selecting an attachment, focus should be transferred to the right details panel.
if ( ! isTouchDevice ) {
$('.attachment-details input').first().focus();
}