Nav Menus: Delegate click events for move links.
props ankit.gade. fixes #25594. Built from https://develop.svn.wordpress.org/trunk@26613 git-svn-id: http://core.svn.wordpress.org/trunk@26503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
10f58cded3
commit
bfc16271ca
|
@ -379,27 +379,29 @@ var wpNavMenu;
|
|||
},
|
||||
|
||||
initAccessibility : function() {
|
||||
var menu = $( '#menu-to-edit' );
|
||||
|
||||
api.refreshKeyboardAccessibility();
|
||||
api.refreshAdvancedAccessibility();
|
||||
|
||||
// Events
|
||||
$( '.menus-move-up' ).on( 'click', function ( e ) {
|
||||
menu.on( 'click', '.menus-move-up', function ( e ) {
|
||||
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'up' );
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '.menus-move-down' ).on( 'click', function ( e ) {
|
||||
})
|
||||
menu.on( 'click', '.menus-move-down', function ( e ) {
|
||||
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'down' );
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '.menus-move-top' ).on( 'click', function ( e ) {
|
||||
})
|
||||
menu.on( 'click', '.menus-move-top', function ( e ) {
|
||||
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'top' );
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '.menus-move-left' ).on( 'click', function ( e ) {
|
||||
})
|
||||
menu.on( 'click', '.menus-move-left', function ( e ) {
|
||||
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'left' );
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '.menus-move-right' ).on( 'click', function ( e ) {
|
||||
menu.on( 'click', '.menus-move-right', function ( e ) {
|
||||
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'right' );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue