Customizer: Remove some non-functional code.
props afercia. fixes #32839. git-svn-id: https://develop.svn.wordpress.org/trunk@33070 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e430245d00
commit
55d7ab3da5
|
@ -477,44 +477,13 @@
|
|||
this.$search.val( '' );
|
||||
},
|
||||
|
||||
// Add keyboard accessiblity to the panel
|
||||
// Add a few keyboard enhancements to the panel.
|
||||
keyboardAccessible: function( event ) {
|
||||
var isEnter = ( 13 === event.which ),
|
||||
isEsc = ( 27 === event.which ),
|
||||
isDown = ( 40 === event.which ),
|
||||
isUp = ( 38 === event.which ),
|
||||
isBackTab = ( 9 === event.which && event.shiftKey ),
|
||||
selected = null,
|
||||
firstVisible = this.$el.find( '> .menu-item-tpl:visible:first' ),
|
||||
lastVisible = this.$el.find( '> .menu-item-tpl:visible:last' ),
|
||||
isSearchFocused = $( event.target ).is( this.$search );
|
||||
|
||||
if ( isDown || isUp ) {
|
||||
if ( isDown ) {
|
||||
if ( isSearchFocused ) {
|
||||
selected = firstVisible;
|
||||
} else if ( this.selected && 0 !== this.selected.nextAll( '.menu-item-tpl:visible' ).length ) {
|
||||
selected = this.selected.nextAll( '.menu-item-tpl:visible:first' );
|
||||
}
|
||||
} else if ( isUp ) {
|
||||
if ( isSearchFocused ) {
|
||||
selected = lastVisible;
|
||||
} else if ( this.selected && 0 !== this.selected.prevAll( '.menu-item-tpl:visible' ).length ) {
|
||||
selected = this.selected.prevAll( '.menu-item-tpl:visible:first' );
|
||||
}
|
||||
}
|
||||
|
||||
this.select( selected );
|
||||
|
||||
if ( selected ) {
|
||||
selected.focus();
|
||||
} else {
|
||||
this.$search.focus();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// If enter pressed but nothing entered, don't do anything
|
||||
if ( isEnter && ! this.$search.val() ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue