mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-30 08:08:10 +02:00
media.view.Attachment
: set all of the view attributes in the same hash.
See [29299], #23560. Built from https://develop.svn.wordpress.org/trunk@29562 git-svn-id: http://core.svn.wordpress.org/trunk@29337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
afe7639c7b
commit
8f810cbaa4
@ -4664,9 +4664,14 @@
|
|||||||
className: 'attachment',
|
className: 'attachment',
|
||||||
template: media.template('attachment'),
|
template: media.template('attachment'),
|
||||||
|
|
||||||
attributes: {
|
attributes: function() {
|
||||||
tabIndex: 0,
|
return {
|
||||||
role: 'checkbox'
|
'tabIndex': 0,
|
||||||
|
'role': 'checkbox',
|
||||||
|
'aria-label': this.model.get( 'title' ),
|
||||||
|
'aria-checked': false,
|
||||||
|
'data-id': this.model.get( 'id' )
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
@ -4688,11 +4693,6 @@
|
|||||||
options = _.defaults( this.options, {
|
options = _.defaults( this.options, {
|
||||||
rerenderOnModelChange: true
|
rerenderOnModelChange: true
|
||||||
} );
|
} );
|
||||||
this.$el.attr( {
|
|
||||||
'aria-label' : this.model.get( 'title' ),
|
|
||||||
'aria-checked': false,
|
|
||||||
'data-id' : this.model.get( 'id' )
|
|
||||||
} );
|
|
||||||
|
|
||||||
if ( options.rerenderOnModelChange ) {
|
if ( options.rerenderOnModelChange ) {
|
||||||
this.model.on( 'change', this.render, this );
|
this.model.on( 'change', this.render, this );
|
||||||
@ -4954,7 +4954,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add 'selected' class to model, set aria-checked to true and make the checkbox tabable.
|
// 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' );
|
this.$el.addClass( 'selected' ).attr( 'aria-checked', true )
|
||||||
|
.find( '.check' ).attr( 'tabindex', '0' );
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {Backbone.Model} model
|
* @param {Backbone.Model} model
|
||||||
@ -4970,7 +4971,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$el.removeClass( 'selected' ).attr( 'aria-checked', false )
|
this.$el.removeClass( 'selected' ).attr( 'aria-checked', false )
|
||||||
.find( '.check' ).attr( 'tabindex', '-1' );
|
.find( '.check' ).attr( 'tabindex', '-1' );
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {Backbone.Model} model
|
* @param {Backbone.Model} model
|
||||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user