~canonical-sysadmins/wordpress/4.7.2

« back to all changes in this revision

Viewing changes to wp-includes/js/tinymce/plugins/wplink/plugin.js

  • Committer: Barry Price
  • Date: 2016-04-27 04:42:45 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: barry.price@canonical.com-20160427044245-ob1jzpeq2ex7jv07
Merge WP 4.5.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
440
440
                                                        $input.autocomplete( 'search' );
441
441
                                                }
442
442
                                        } )
 
443
                                        // Returns a jQuery object containing the menu element.
443
444
                                        .autocomplete( 'widget' )
444
445
                                                .addClass( 'wplink-autocomplete' )
445
446
                                                .attr( 'role', 'listbox' )
446
 
                                                .removeAttr( 'tabindex' ); // Remove the `tabindex=0` attribute added by jQuery UI.
 
447
                                                .removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
 
448
                                                /*
 
449
                                                 * Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
 
450
                                                 * The `menufocus` and `menublur` events are the same events used to add and remove
 
451
                                                 * the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
 
452
                                                 */
 
453
                                                .on( 'menufocus', function( event, ui ) {
 
454
                                                        ui.item.attr( 'aria-selected', 'true' );
 
455
                                                })
 
456
                                                .on( 'menublur', function() {
 
457
                                                        /*
 
458
                                                         * The `menublur` event returns an object where the item is `null`
 
459
                                                         * so we need to find the active item with other means.
 
460
                                                         */
 
461
                                                        $( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
 
462
                                                });
447
463
                                }
448
464
 
449
465
                                tinymce.$( input ).on( 'keydown', function( event ) {