Make WordPress Core

Changeset 29562


Ignore:
Timestamp:
08/21/2014 02:52:24 AM (11 years ago)
Author:
wonderboymusic
Message:

media.view.Attachment: set all of the view attributes in the same hash.

See [29299], #23560.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r29560 r29562  
    46654665        template:  media.template('attachment'),
    46664666
    4667         attributes: {
    4668             tabIndex: 0,
    4669             role: 'checkbox'
     4667        attributes: function() {
     4668            return {
     4669                'tabIndex':     0,
     4670                'role':         'checkbox',
     4671                'aria-label':   this.model.get( 'title' ),
     4672                'aria-checked': false,
     4673                'data-id':      this.model.get( 'id' )
     4674            };
    46704675        },
    46714676
     
    46894694                    rerenderOnModelChange: true
    46904695                } );
    4691             this.$el.attr( {
    4692                 'aria-label'  : this.model.get( 'title' ),
    4693                 'aria-checked': false,
    4694                 'data-id'     : this.model.get( 'id' )
    4695             } );
    46964696
    46974697            if ( options.rerenderOnModelChange ) {
     
    49554955
    49564956            // Add 'selected' class to model, set aria-checked to true and make the checkbox tabable.
    4957             this.$el.addClass( 'selected' ).attr( 'aria-checked', true ).find( '.check' ).attr( 'tabindex', '0' );
     4957            this.$el.addClass( 'selected' ).attr( 'aria-checked', true )
     4958                .find( '.check' ).attr( 'tabindex', '0' );
    49584959        },
    49594960        /**
     
    49714972            }
    49724973            this.$el.removeClass( 'selected' ).attr( 'aria-checked', false )
    4973                     .find( '.check' ).attr( 'tabindex', '-1' );
     4974                .find( '.check' ).attr( 'tabindex', '-1' );
    49744975        },
    49754976        /**
Note: See TracChangeset for help on using the changeset viewer.